-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Plotly examples bug fixes #33507
base: master
Are you sure you want to change the base?
Plotly examples bug fixes #33507
Conversation
📊 Bundle size report✅ No changes found |
Pull request demo site: URL |
change/@fluentui-react-charting-93685ac9-5787-4456-9159-5670992837e0.json
Show resolved
Hide resolved
packages/charts/react-charting/src/components/DeclarativeChart/DeclarativeChart.tsx
Show resolved
Hide resolved
packages/charts/react-charting/src/components/DeclarativeChart/DeclarativeChart.tsx
Outdated
Show resolved
Hide resolved
x: updateXValues(dataPoint.x), | ||
})); | ||
const chartProps = { | ||
...transformPlotlyJsonToScatterChartProps({ data: updatedData, layout }, isAreaChart, colorMap, isDarkTheme), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be handled in chartProps only, right? Also I missed componentRef={chartRef}, that also will add. Or what do you suggest, should I remove renderChart and duplicate Areachart and linechart render statements ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add line specific legend props to chartProps if it is line. This check will anyways go away in couple of days.
|
||
export const updateXValues = (xValues: any[]): any[] => { | ||
const presentYear = new Date().getFullYear(); | ||
const dates = xValues.map(monthValue => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const isMonthArray = (array: any[]): boolean => { | ||
if (array && array.length > 0) { | ||
const presentYear = new Date().getFullYear(); | ||
return array.every(monthValue => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -272,7 +304,6 @@ export const transformPlotlyJsonToScatterChartProps = ( | |||
isDarkTheme?: boolean, | |||
): ILineChartProps | IAreaChartProps => { | |||
const { data, layout } = jsonObj; | |||
|
|||
const chartData: ILineChartPoints[] = data.map((series: any, index: number) => { | |||
const xValues = series.x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert removing empty line
New Behavior
Following bugs are fixed:
Functionality added:
To support month names as x-axis labels in line and area chart.
Related Issue(s)