-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
added custom properties attribute to line chart bar data #1664
base: main
Are you sure you want to change the base?
Conversation
@imaNNeo, |
Yes, there are issues with this PR,
|
Thanks for your reply :)
|
@@ -397,6 +401,9 @@ class LineChartBarData with EquatableMixin { | |||
isStepLineChart: b.isStepLineChart, | |||
lineChartStepData: | |||
LineChartStepData.lerp(a.lineChartStepData, b.lineChartStepData, t), | |||
properties: {} | |||
..addAll(a.properties) |
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.
Hi, sorry for my late reply.
You should not do this here. Because everytime you set a new value to the properties list, it adds to the previous map and it is not a correct behaviour.
Suppose that you have:
{
"title": "Hello"
}
And in the next setState, you change it to
{
"name": "Hello"
}
And in the end you have:
{
"title": "Help",
"name": "Hello"
}
which is not correct in my opinion
So I suggest to have a dynamic type and in the lerp method, we can have
properties: b.properties
Hi, thanks for providing this awesome library.
In this PR, I added a
properties
attribute asMap<string, dynamic>
in order to store optional line curve parameters, like name or any other curve setting. by this change if you have multiple curves in a chart, now it's possible to show the name of each curve next to the value on the tooltip message.