-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
base: master
Are you sure you want to change the base?
Conversation
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); |
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.
I feel like it should default to url(#fillShadowGradient
..., to make this change backwards compatible
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.
this change looks like it would change behaviour for existing users
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.
Approved.
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