Skip to content

feat(react-charts): Add support for secondary y axis in cartesian charts #34665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 20, 2025

Conversation

Anush2303
Copy link
Contributor

@Anush2303 Anush2303 commented Jun 17, 2025

New Behavior

Support for secondary y axis is added in cartesian charts.
Corresponding v8 commit migrated to v9:
d5a6890

Related Issue(s)

  • Fixes #

@Anush2303 Anush2303 marked this pull request as ready for review June 17, 2025 10:11
@Anush2303 Anush2303 requested a review from a team as a code owner June 17, 2025 10:11
@AtishayMsft
Copy link
Contributor

Can you resolve merge conflict so we can see the PR storybook

@krkshitij
Copy link
Contributor

krkshitij commented Jun 18, 2025

The findVSBCNumericMinMaxOfY function also needs to be updated:

export function findVSBCNumericMinMaxOfY(dataset: DataPoint[]): { startValue: number; endValue: number } {
const yMax = d3Max(dataset, (point: DataPoint) => point.y)!;
const yMin = d3Min(dataset, (point: DataPoint) => point.y)!;
return { startValue: yMin, endValue: yMax };
}

For reference:

private _getMinMaxOfYAxis = (
dataset: IDataPoint[],
yAxisType?: YAxisType,
useSecondaryYScale?: boolean,
): { startValue: number; endValue: number } => {
if (!useSecondaryYScale) {
return findVSBCNumericMinMaxOfY(dataset);
}
const values: number[] = [];
this.props.data.forEach(xPoint => {
xPoint.lineData?.forEach(point => {
if (point.useSecondaryYScale) {
values.push(point.y as number);
}
});
});
return { startValue: d3Min(values)!, endValue: d3Max(values)! };
};

Copy link

github-actions bot commented Jun 18, 2025

📊 Bundle size report

✅ No changes found

Copy link

Pull request demo site: URL

@AtishayMsft
Copy link
Contributor

Could you run and validate playwright report.

@Anush2303
Copy link
Contributor Author

Could you run and validate playwright report.

Yes, ran the report.

Copy link
Contributor

@AtishayMsft AtishayMsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@Anush2303 Anush2303 merged commit 6ad03ce into microsoft:master Jun 20, 2025
14 of 15 checks passed
@Anush2303 Anush2303 deleted the usr/agupta/portv8Fixes branch June 20, 2025 09:35
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Jun 24, 2025
* master: (51 commits)
  release: applying package updates - react v8
  fix(react-charting): Improve legend selection for Scatter charts (microsoft#34701)
  release: applying package updates - web-components
  [fix]: vertical tablist and start and end slots in tabs were broken (microsoft#34704)
  feat: shorten pollDuration to 100ms (microsoft#34703)
  fix(web-components): add dropdown anchor positioning fallback (microsoft#34647)
  React-Carousel: Call emblaApi destroy on unmount (microsoft#34686)
  release: applying package updates - react-components
  feat: improve useSafeZoneArea() hook (microsoft#34677)
  release: applying package updates - react v8
  feat(react-charts): Add support for negative Y values in GVBC (microsoft#34687)
  feat(react-charting): enable wrapping of string x-axis labels in DeclarativeChart + hide overlapping labels based on post-transform width (microsoft#34666)
  feat(react-charts): Add support for negative VSBC (microsoft#34668)
  fix(react-charting): correct bar height rendering for values less than 1 in VSBC (microsoft#34680)
  feat(react-charts): Add support for secondary y axis in cartesian charts (microsoft#34665)
  release: applying package updates - web-components
  fix: progress bar when value is missing in firefox and safari (microsoft#34684)
  release: applying package updates - react v8
  release: applying package updates - web-components
  refactor: use css attr func to calculate progress bar width when supp… (microsoft#34674)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants