Skip to content
Open
Show file tree
Hide file tree
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): Enhance logging",
"packageName": "@fluentui/chart-utilities",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,16 @@ const validateBarData = (data: Partial<PlotData>) => {
}
validateSeriesData(data, false);
} else if (!isNumberArray(data.y) && !isStringArray(data.y)) {
throw new Error(`Non numeric or string Y values encountered, type: ${typeof data.y}`);
let hierarchyInfo = '';
if (Array.isArray(data.y) && typeof data.y[0] === 'object' && data.y[0] !== null) {
const numHierarchies = data.y.length;
const hierarchyLengths = data.y.map((obj: any) => (obj && typeof obj === 'object' ? Object.keys(obj).length : 0));
hierarchyInfo = `; y object hierarchies: ${numHierarchies}; hierarchy lengths: [${hierarchyLengths.join(', ')}]`;
}
throw new Error(`Non numeric or string Y values encountered, type: ${typeof data.y}${hierarchyInfo}`);
}
};

const isScatterMarkers = (mode: string): boolean => {
return ['markers', 'text+markers', 'markers+text'].includes(mode);
};
Expand Down
Loading