AnyChart-Android
AnyChart-Android copied to clipboard
Can't implement dual light/dark mode charts!
Hi! I want to implement dark mode setting in my app so chart can take light and dark background dinamically. But I can't set color programmatilly. Any alternative?
@aerizzo All chart types support coloring background via API. Please, can you specify what chart type you are using?
@aerizzo All chart types support coloring background via API. Please, can you specify what chart type you are using?
Thanks for your answer Alexander, I want to change background and grid color on a Cartesian chart added to my AnyChartView object. Only method I found to change a background is related to chat view (anyChartView.setBackgroundColor(...);) Another question, if is this possible, can I change color dinamically and show new color schema through anyChartView.invalidate()? Any help is welcome
@aerizzo For this purpose, you should use the library API. The following code describes how to adjust the chart background and grids:
Cartesian cartesian = AnyChart.bar();
cartesian.background().enabled(true);
cartesian.background().fill("black");
cartesian.xGrid(0).enabled(true).stroke("red");
cartesian.yGrid(0).enabled(true).stroke("red");
// rest of chart configuration code
The result below:

So the android lib does not support dark mode?