Skip to content
Merged
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,6 @@
{
"type": "patch",
"packageName": "@fluentui/react-charting",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "feat: enable wrapping of string x-axis labels in scatterchart",
"packageName": "@fluentui/react-charts",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ const transformPlotlyJsonToScatterTraceProps = (
let mode: string = 'tonexty';
const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
const yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
var shouldWrapLabels = false;
const chartData: ILineChartPoints[] = input.data
.map((series: Partial<PlotData>, index: number) => {
const colors = isScatterMarkers
Expand All @@ -1149,6 +1150,7 @@ const transformPlotlyJsonToScatterTraceProps = (
const isXDate = isDateArray(xValues);
const isXNumber = isNumberArray(xValues);
const isXYearCategory = isYearArray(series.x); // Consider year as categorical not numeric continuous axis
shouldWrapLabels = shouldWrapLabels || (isXString && !isXDate);
const legend: string = legends[index];
// resolve color for each legend's lines from the extracted colors
const seriesColor = resolveColor(
Expand Down Expand Up @@ -1263,6 +1265,7 @@ const transformPlotlyJsonToScatterTraceProps = (
hideLegend,
useUTC: false,
optimizeLargeData: numDataPoints > 1000,
shouldWrapLabels: shouldWrapLabels,
...getTitles(input.layout),
...getXAxisTickFormat(input.data[0], input.layout),
...yAxisTickFormat,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ Object {
"hideTickOverlap": true,
"mode": "tonexty",
"optimizeLargeData": false,
"shouldWrapLabels": false,
"supportNegativeData": true,
"useUTC": false,
"width": undefined,
Expand Down Expand Up @@ -4890,6 +4891,7 @@ Object {
"hideTickOverlap": true,
"optimizeLargeData": false,
"roundedTicks": true,
"shouldWrapLabels": false,
"supportNegativeData": true,
"useUTC": false,
"width": undefined,
Expand Down Expand Up @@ -6586,6 +6588,7 @@ Object {
"hideTickOverlap": true,
"optimizeLargeData": false,
"roundedTicks": true,
"shouldWrapLabels": false,
"showYAxisLablesTooltip": true,
"supportNegativeData": true,
"useUTC": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ const transformPlotlyJsonToScatterTraceProps = (
let mode: string = 'tonexty';
const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
const yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
var shouldWrapLabels = false;
const chartData: LineChartPoints[] = input.data
.map((series: Partial<PlotData>, index: number) => {
const colors = isScatterMarkers
Expand All @@ -1025,6 +1026,7 @@ const transformPlotlyJsonToScatterTraceProps = (
const isXDate = isDateArray(xValues);
const isXNumber = isNumberArray(xValues);
const isXYearCategory = isYearArray(series.x); // Consider year as categorical not numeric continuous axis
shouldWrapLabels = shouldWrapLabels || (isXString && !isXDate);
const legend: string = legends[index];
// resolve color for each legend's lines from the extracted colors
const seriesColor = resolveColor(extractedColors, index, legend, colorMap, isDarkTheme);
Expand Down Expand Up @@ -1105,6 +1107,7 @@ const transformPlotlyJsonToScatterTraceProps = (
hideTickOverlap: true,
hideLegend,
useUTC: false,
wrapXAxisLables: shouldWrapLabels,
optimizeLargeData: numDataPoints > 1000,
...getTitles(input.layout),
...getXAxisTickFormat(input.data[0], input.layout),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4658,6 +4658,7 @@ Object {
"supportNegativeData": true,
"useUTC": false,
"width": undefined,
"wrapXAxisLables": false,
"xAxisTitle": "",
"yAxisTitle": "",
"yMaxValue": 16.562957844203055,
Expand Down Expand Up @@ -5059,6 +5060,7 @@ Object {
"supportNegativeData": true,
"useUTC": false,
"width": undefined,
"wrapXAxisLables": false,
"xAxisTitle": "",
"yAxisTitle": "",
}
Expand Down Expand Up @@ -5206,6 +5208,7 @@ Object {
"supportNegativeData": true,
"useUTC": false,
"width": undefined,
"wrapXAxisLables": false,
"xAxisTitle": "",
"yAxisTitle": "",
"yMaxValue": 1.0620659379275244,
Expand Down