Skip to content

fix(react-charting): Fixing area chart bugs for undefined property access #34299

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 5 commits into from
May 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix(chart-utilities): Fixing area chart bugs for undefined property access",
"packageName": "@fluentui/chart-utilities",
"email": "120183316+srmukher@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix(react-charting): Fixing area chart bugs for undefined property access",
"packageName": "@fluentui/react-charting",
"email": "120183316+srmukher@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -293,6 +293,11 @@ export const mapFluentChart = (input: any): OutputChartType => {
const isXNumber = isNumberArray(firstScatterData.x);
if (isXDate || isXNumber) {
return { isValid: true, type: isAreaChart ? 'area' : 'line', validTracesInfo: validTraces };
} else if (isAreaChart) {
return {
isValid: false,
errorMessage: 'Fallback to VerticalStackedBarChart is not allowed for Area Charts.',
};
}
return { isValid: true, type: 'fallback', validTracesInfo: validTraces };
}
Original file line number Diff line number Diff line change
@@ -192,6 +192,9 @@ export const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps> =
}
// Unsupported schema, render as VerticalStackedBarChart
fallbackVSBC = true;
if (isAreaChart) {
throw new Error('Fallback to VerticalStackedBarChart is not allowed for Area Charts.');
}
return (
<ResponsiveVerticalStackedBarChart
{...transformPlotlyJsonToVSBCProps(plotlyInputWithValidData, colorMap, isDarkTheme, fallbackVSBC)}
Loading