Pooja Gaonkar
Pooja Gaonkar

Reputation: 1566

Line graph with achartengine android

Iam having problems with displaying the chart values for a line graph in achartengine. I fetch the data for the lines in an array from the database. The line is plotted perfectly with each point showing. I use renderer.isDisplayChartValues(); to display values above the points. But the problem is only few values are displayed above the point whereas some have just the points with no values displayed.

heres my code:

rendererA = new XYSeriesRenderer();
        rendererA.setDisplayChartValues(true);
        rendererA.isDisplayChartValues();
        rendererA.setColor(Color.parseColor("#FFDC143C"));
        rendererA.setPointStyle(PointStyle.CIRCLE);
        rendererA.setFillPoints(true);
        rRenderer.addSeriesRenderer(rendererA);

        rendererB= new XYSeriesRenderer();
        rendererB.setDisplayChartValues(true);
        rendererB.setPointStyle(PointStyle.CIRCLE);

        rendererB.setColor(Color.parseColor("#FF6B8E23"));
        rendererB.setFillPoints(true);
        rRenderer.addSeriesRenderer(rendererB);

Here is a screenshot. Any help is appreciated. Thank you.

enter image description here

Upvotes: 3

Views: 928

Answers (1)

Dan D.
Dan D.

Reputation: 32391

You can modify the minimum distance (in pixels) between chart values in order to get several of them displayed. For instance:

renderer.setDisplayChartValuesDistance(50);

Upvotes: 1

Related Questions