Closed stockiNail closed 2 years ago
Impressive!
I had some comments and I think some more tests with scales not starting from zero. I think we need to cover all these scale cases: 0-positive (covered) negative-0 positive-positive negative-positive negative-negative
Yes, I put it in Draft because there a couple of things where I have to pay attention:
1. change the calculation of percentage using
getPixelStop
(unique way everywhere)2. understand if the
afterDraw
hook is the right one to change the legend. I think it could be a problem if the animation is disabled3. destroy the state when the chart is destroying
This afternoon I didn't have time to go on. I'll do asap.
EDIT: hopefully I have time tomorrow. Sorry :(
I think we need to cover all these scale cases: 0-positive (covered) negative-0 positive-positive negative-positive negative-negative
Done. Maybe I could add the same tests on radial linear (done only cartesian linear).
EDIT: added the additional test cases to the radial linear axis.
@kurkle 41 files.... I know you don't like big PR. Sorry for that.
EDIT: 42!
I'm not sure about the state handling, but that is internals and can be changed at any time.
OK. I can review later. I tought about the structure, using map. And also an another issue was that even if the dataset is hidden, the state should be present for the legend.
Fix #28
This PR is enabling to set
fillStyle
andstrokeStyle
on the legend items related to datasets where the gradient has been set.It is applying only
backgroundColor
andborderColor
, if set.It doesn't go in exception on CHART.JS version 2.x but it can not enable the styles on legend items because the legend size calculation is done in a different time of chart lifecycle.
TODO