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(react-chart): add palette plugin #1408

Merged
merged 17 commits into from
Sep 25, 2018

Conversation

Krijovnick
Copy link
Contributor

No description provided.


import { Scale, Theme } from '@devexpress/dx-react-chart';

const materialUI = ['#2196F3', '#F44336', '#4CAF50', '#FFEB3B', '#E91E63', '#9C27B0'];
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we should use MaterialDesignColors instead MaterialUI because material-ui is only react library.
Add more colors to that palette from official site https://material.io/design//color/the-color-system.html#tools-for-picking-colors

Copy link
Contributor Author

@Krijovnick Krijovnick Sep 19, 2018

Choose a reason for hiding this comment

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

I'll change the name to MaterialDesignColors.
And why does we need to add more colors to that palette?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because colors are repeated and it looks bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But other schemes has not many colors too.

@MaximKudriavtsev
Copy link
Contributor

Can we implement this feature without add Theme plugin to markup? It looks excess because the Chart should have colors always.

@Krijovnick
Copy link
Contributor Author

@MaximKudriavtsev I think this was the point because we have plugin structure.

@MaximKudriavtsev
Copy link
Contributor

@Krijovnick but this plugin is required. I should always add this plugin to my markup, I think this is problem.

@Krijovnick Krijovnick changed the title feat(react-chart): add theme plugin feat(react-chart): add palette plugin Sep 19, 2018
@@ -0,0 +1,19 @@
# Palette Plugin Reference

The `Palette` plugin is used to colorize chart with default or user colors.
Copy link
Contributor

Choose a reason for hiding this comment

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

The Palette plugin is used to colorize chart with user colors. without default colors, because to apply default colors not necessary to add this plugin


## Basic Setup

Use `scheme` property in `Palette` plugin to set up a Chart with custom color. In the following example demonstrates the changing of the colors using d3 library.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a link to Palette API


Name | Type | Default | Description
-----|------|---------|------------
scheme? | Array<string> | ['#0070ff', '#d72e3d', '#249d3d', '#ffb90c', '#1698af', '#616a72'] for [Bootstrap4](https://www.npmjs.com/package/@devexpress/dx-react-chart-bootstrap4); ['#40C4FF', '#FF5252', '#00C853', '#FFEB3B', '#FF4081', '#E040FB'] for [Material UI](https://www.npmjs.com/package/@devexpress/dx-react-chart-material-ui); | Array of colors.
Copy link
Contributor

Choose a reason for hiding this comment

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

The scheme property is required in propTypes

@Krijovnick Krijovnick merged commit a025bb0 into DevExpress:master Sep 25, 2018
@Krijovnick Krijovnick deleted the theme_manager_extract branch September 25, 2018 10:59
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.

5 participants