Skip to content Skip to sidebar Skip to footer

Mpandroidchart Combinedchart - How To Prevent Linedata Circles Being Drawn Over Bubble Data?

I have been playing with the official CombinedChartActivity example to show 2 line charts, 1 bar chart and some bubble data. Despite having changed the DrawOrder... mChart.setDrawO

Solution 1:

Check the source code for CombinedChartRenderer and for BarLineChartBase.

The base renderer draws the data first. For CombinedChartRenderer, this means iterating through all of the sub-renderers and drawing their data (lines for the LineChart and bubbles for the BubbleChart).

After that, the base renderer will render the extras. For CombinedChartRenderer, this means iterating through all of the sub-renderers and drawing their extras.

Because the circles in the LineChart are extras they are drawn after all the data. This means that you will have to find some way to rearrange the order of rendering to meet the requirement. You could start by subclassing CombinedChart and overriding the protected void onDraw(Canvas canvas) method to change the order to meet your custom requirement.

There is a complete solution (including code) to a problem similar to yours in this answer

Post a Comment for "Mpandroidchart Combinedchart - How To Prevent Linedata Circles Being Drawn Over Bubble Data?"