Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Anush2303
Copy link
Contributor

@Anush2303 Anush2303 commented Dec 23, 2024

New Behavior

Following bugs are fixed:

  1. https://uifabric.visualstudio.com/iss/_workitems/edit/11661
  2. https://uifabric.visualstudio.com/iss/_workitems/edit/11662
  3. https://uifabric.visualstudio.com/iss/_workitems/edit/11671

Functionality added:
To support month names as x-axis labels in line and area chart.

image

Related Issue(s)

  • Fixes #

Copy link

github-actions bot commented Dec 23, 2024

📊 Bundle size report

✅ No changes found

Copy link

Pull request demo site: URL

@Anush2303 Anush2303 marked this pull request as ready for review December 23, 2024 04:44
@Anush2303 Anush2303 requested a review from a team as a code owner December 23, 2024 04:44
x: updateXValues(dataPoint.x),
}));
const chartProps = {
...transformPlotlyJsonToScatterChartProps({ data: updatedData, layout }, isAreaChart, colorMap, isDarkTheme),
Copy link
Contributor

Choose a reason for hiding this comment

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

transformPlotlyJsonToScatterChartProps

where are you handling different legendProps for line chart

Copy link
Contributor Author

@Anush2303 Anush2303 Dec 23, 2024

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 ?

Copy link
Contributor

@AtishayMsft AtishayMsft Dec 23, 2024

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 => {
Copy link
Contributor

Choose a reason for hiding this comment

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

monthValue

rename to possiblyMonthValue

export const isMonthArray = (array: any[]): boolean => {
if (array && array.length > 0) {
const presentYear = new Date().getFullYear();
return array.every(monthValue => {
Copy link
Contributor

Choose a reason for hiding this comment

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

monthValue

here also

@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

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

revert removing empty line

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