More formatting options on chart legends
elarue53078 opened this issue · comments
elarue53078 commented
In discussing chartkick implementations, our team noticed certain ways we'd like to format the legend that we seem to be unable to do:
- The legend seems to put all the legend objects on one line; we would like the option to put each element on its own line.
- In connection with the above, we would like to left-align the legend elements. Currently only the default center alignment appears to be available.
- The color keys are currently rectangles. We would like to change this to squares.
Andrew Kane commented
Hey @elarue53078, you can use library
option to make make customizations that the underlying charting library supports.
Bhanu Sigdel commented
@ankane I am using the options like this:
library: { legend: { display: false, position: 'bottom', labels: { usePointStyle: true, boxWidth: 6 } } }
Also tried:
library: { options: { plugins: { legend: { display: true, position: 'bottom', labels: { usePointStyle: true, boxWidth: 6 } } } } }
Also tried:
library: { options: { legend: { display: true, position: 'bottom', labels: { usePointStyle: true, boxWidth: 6 } } } }
None worked. I am using Chart.js
and it has the options I provided above.
Am I doing something wrong?
maxlein commented
This is also not working for me