I could not find a method/setting that would allow to disable the legend completely and reuse the area available for the legend for the chart view itself. Suppose I have a 100 x 100 view and set it as a pie chart view, the legend takes up space on the bottom (default setting). If I mask off the legend somehow since I did not find an api for that (using clear color) the area still shows up empty (the chart is on the upper ~80-90% of the view it seems. Is there a way to completely disable the legend and show the chart in the center of the view?
I remember setting ChartLegend.enabled = false;
will not calculate the space? Anway, take a look at calculateOffsets()
in PieRadarChartViewBase
, it calculates the space there. You should be able to change it.
Whoa! That did it. I poured over each and every property of ChartLegend, but should have just looked at the super class. Thanks @liuxuan30
Closing issue!
This also works.
ChartLegend *l = _chartView.legend;
l.enabled = false;
Most helpful comment
I remember setting
ChartLegend.enabled = false;
will not calculate the space? Anway, take a look atcalculateOffsets()
inPieRadarChartViewBase
, it calculates the space there. You should be able to change it.