Open t47io opened 6 years ago
An oversight on my part. Legends were a long-missing key element, but you are right that on the web in the presence of tooltips they are redundant, as they were before.
The new legend is a good addition, but just should be optional and user-controllable. I think I can make a PR to add an option showLegend
that overrides the internal logic. Does that sound good?
Option showLegend: 0
doesn't work yet.
Please, consider this. Thanks
fwiw: I created PR #389 to address this as it's functionality I need for what I'm working on.
Unfortunately, the legend for pie/donut charts have no configuration options at all - we're looking to implement legends on the RHS of the chart, stacked vertically rather than horizontally.
As a workaround, we're kinda cheating this...
<div class="grid cols-2 gap-4 w-full">
<div>
<div id="chart"></div>
</div>
<div>
<div class="flex flex-col items-center">
<!-- add custom legend here -->
</div>
</div>
</div>
let chart = new Chart('#chart', ...);
.frappe-chart .chart-legend {
display: none;
}
However, it does get a bit annoying as the legend itself takes some space on the SVG - so you're not getting "full height" charts still.
After 5 years showLegend: 0 still not work :(
Expected Behaviour
The new
showLegend
option in1.1.0
should be customizable.Actual Behaviour
It's always
on
and cannot be turned off when there is more than 1 datasetSteps to Reproduce:
NOTE: Add a GIF/Screenshot if required.
Frappé Charts version: 1.1.0