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

feat(charts): Update V9 Charts to use DataVizGradientPalette #33323

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

Conversation

shawn-grant
Copy link
Contributor

@shawn-grant shawn-grant commented Nov 21, 2024

Implement DataVizGradientPalette and rounded corners in v9 charts as default

Modified

  • DonutChart
  • HorizontalBarChart

New Behavior (UI)

DonutChart

With Custom Gradient
image

HorizontalBarChart

image

With Custom Gradient
image

Notable Changes:

  • Added DataVizGradientPalette in utilities/gradients.ts
  • Updated color properties to support gradients in types/DataPoint.ts
  • Added new stories showing custom gradients

New Usage

const data: ChartProps = {
  chartData: [
    {
      legend: 'first',
      data: 20000,
      // single color (existing behavior)
      color: "#5cc300",
    },
    {
      legend: 'second',
      data: 39000,
      // using DataVizGradientPalette
      color: getGradientFromToken(DataVizGradientPalette.gradient1),
    },
    {
      legend: 'second',
      data: 10000,
      // using custom gradient
      color: [ '#ff88cc', '#db3794' ],
    },
  ],
};

TODO

  • VerticalBarChart

Related

#32008

@shawn-grant shawn-grant marked this pull request as ready for review November 21, 2024 20:27
@shawn-grant shawn-grant requested a review from a team as a code owner November 21, 2024 20:27
@AtishayMsft
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

github-actions bot commented Nov 22, 2024

📊 Bundle size report

✅ No changes found

@AtishayMsft
Copy link
Contributor

PR CI is failing.

Copy link

Pull request demo site: URL

@AtishayMsft
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@shawn-grant
Copy link
Contributor Author

PR CI is failing.

CI error should be fixed with this commit 0cc5413

@AtishayMsft
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AtishayMsft
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

*/
color: string;
gradient: [string, string];
Copy link
Contributor

Choose a reason for hiding this comment

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

the term gradient is confusing. Lets use color only with this structure -> string | [string, string]

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant in all places.

Copy link
Contributor Author

@shawn-grant shawn-grant Nov 26, 2024

Choose a reason for hiding this comment

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

ohh, ok, so it should work with either a single color string or gradient tuple. Will make the changes

Copy link
Contributor

Choose a reason for hiding this comment

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

correct.

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