Skip to content

[Bug]: Not able to show selected y-value in the tooltip in a line chart #34727

Open
@abhranilnaha

Description

@abhranilnaha

Charting Control

LineChart

Package version

5.23.92

React version

19.0.0

Environment

https://codepen.io/abhranilnaha/pen/raVPmer

Current Behavior

When user hovers over a data point in a line chart, it shows all the data points for the vertical line, instead of showing showing the data point on which user hovered.

Image

Expected Behavior

We should have capability to get the y-value for the selected data point in the line chart.

Reproduction

https://codepen.io/abhranilnaha/pen/raVPmer

Steps to reproduce

  1. Try following link:
    https://codepen.io/abhranilnaha/pen/raVPmer

  2. Hover over any data point and it shows the first data point in the tooltip.

Image

  1. onRenderCalloutPerDataPoint for Line Chart contains the following props:
    x is the selected x-value and values contain all data point values for the vertical line.

  2. Need capability to get the y-value of the data point on which user hovered.

export interface ICustomizedCalloutData {
    x: number | string | Date;
    values: ICustomizedCalloutDataPoint[];
}
 
export interface ICustomizedCalloutDataPoint {
    legend: string;
    y: number;
    color: string;
    xAxisCalloutData?: string;
    yAxisCalloutData?: string | {
        [id: string]: number;
    };
}

Are you reporting an Accessibility issue?

None

Suggested severity

Urgent - No workaround and Products/sites are affected

Products/sites affected

Fabric Real Time Intelligence

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions