8

Hi all I am very new to chart applications. I created dual line chart using aChartEngine for my android application. I cant set labels for y-axis in my chart.

I got chart like this.....

enter image description here

How can i do this can anybody help me? Thanks in advance.

malavika
  • 1,331
  • 4
  • 21
  • 54

1 Answers1

5

This will help you:

// hide the default labels
mrenderer.setYLabels(0);
// set the custom labels
mrenderer.addYTextLabel(0, "$0");
mrenderer.addYTextLabel(20000, "$20K");
...
// set the visible range
mrenderer.setYAxisMin(0);
mrenderer.setYAxisMax(140000);
Dan D.
  • 32,246
  • 5
  • 63
  • 79
  • Hey Dan i got an error like this The method addYAxisLabel(int, String) is undefined for the type XYMultipleSeriesRenderer – malavika Oct 17 '12 at 07:34
  • ya Dan i got it. Thanks man!!! but if i use like this for(int j=0 ; j – malavika Oct 17 '12 at 07:47
  • 1
    If you want to make it dynamically, then use the below code for(int j=0 ; j – moDev Oct 17 '12 at 11:34
  • it appears we needn't hide the default labels. We just wanted the default labels with two special labels. Awesome library Tx Dan! – Phlip Sep 04 '20 at 19:52