Closed Awarua- closed 8 years ago
I am currently a little swamped with work so I am chipping away at make the legend its own behavior in my spare time. I like the changes you have made in the API.
@robdodson Sorry this is later than I would like, just finished all my university work for the year, and now I believe it is ready for review.
Why not use #generateLegend() method ?
@Awarua- There's a bug, when legend-layout="right"
it becomes center align
@gutenye The main reason I didn't use the built in generate legend, is because I wanted full control, and it was more fun to implement the whole thing.
Regarding the layout right behavior you will have to give me more information. Currently the legend is designed so that if the legend is top or bottom relative to the graph then the legend items are laid out in a row, if the legend is left or right aligned to the graph then the legend items are meant to be in a column.
@Awarua- I may not be clear about it, it should be this picture in a column, instead of the picture showed in my previous comment. i.e. should change align-items: center;
to align-items: flex-start
@gutenye Ah I now see what you mean. Thanks for catching this, I believe I have fixed it in the latest commit.
@Awarua- great :), and don't forget about my RP https://github.com/Awarua-/chart-elements/pull/1
@gutenye I have merged your PR :)
@robdodson now everything is set, from my point, it's good to go. This feature is very important, when will you merge this one?
I'm currently traveling for vacation but will try to review this when I get back next week. If chart.js already provides a legend template ability to the user, I'm a little concerned about implementing our own version of that. It's a lot of technical debt to sign up to maintain and I try to keep these elements as lightweight and close to the original API as possible. Having said that, I haven't had a chance to fully review the code so I may not be seeing the total picture just yet.
No rush, enjoy your vacation :smile:
The Chartjs 2.0 api now supports most of the legend features in this PR. So I am closing it.
I redid the chart elements so they now work closer to the original Chart.js API. If you're interested in updating this PR to work with the new structure that would be awesome