Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to disable legends completely #312

Closed
deepumukundan opened this issue Aug 23, 2015 · 3 comments
Closed

Ability to disable legends completely #312

deepumukundan opened this issue Aug 23, 2015 · 3 comments

Comments

@deepumukundan
Copy link

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?
screen shot 2015-08-23 at 10 34 56 am

@liuxuan30
Copy link
Member

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.

@deepumukundan
Copy link
Author

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!

@Ged2323
Copy link

Ged2323 commented Jun 10, 2020

This also works.

ChartLegend *l = _chartView.legend;
l.enabled = false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants