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

line chart shadow option #561

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kaienss
Copy link

@Kaienss Kaienss commented Oct 1, 2021

Added one option to dataset
shadowColor: similar to color, if not provided, shadow color for the dataset will be the same as the line color with useShadowColorFromDataset:true,
if useShadowColorFromDataset:false,
shadow color will be chartConfig.color.

shadow color is applied with following priority.
dataset.shadowColor -> dataset.color -> chartConfig.color

Added one option to dataset
shadowColor: similar to color, if not provided, shadow color for the dataset will be the same as the line color with useShadowColorFromDataset:true,
if useShadowColorFromDataset:false,
shadow color will be chartConfig.color.

shadow color is applied with following priority.
dataset.shadowColor -> dataset.color -> chartConfig.color
@@ -231,6 +231,10 @@ class LineChart extends AbstractChart<LineChartProps, LineChartState> {
return (dataset.color || this.props.chartConfig.color)(opacity);
};

getShadowColor = (dataset: Dataset, opacity: number) => {
return (dataset.shadowColor || dataset.color || this.props.chartConfig.color)(opacity);
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like it should default to url(#fillShadowGradient..., to make this change backwards compatible

Copy link
Contributor

@Hermanya Hermanya left a comment

Choose a reason for hiding this comment

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

this change looks like it would change behaviour for existing users

@codeplaygoa
Copy link

@Kaienss @Hermanya any update here. I badly need this feature

Copy link

@josh-thompson13 josh-thompson13 left a comment

Choose a reason for hiding this comment

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

Approved.

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.

4 participants