0

I am trying to use Android Plot to display graphs in Android Activity, how can I display my data and label x and y axis in the graph?
I would like to display Months on the X-Axis and Expenses in Y-Axis, and I would like to fetch data from database for the particular category like Food, Personal Expenses etc.. and fetch the graph according to the data.

Please refer the below website code .

http://androidplot.com/wiki/Quickstart

How can I pass List data which is fetched from database(SQLite) to the variables?

Number[] series1Numbers = {1, 8, 5, 2, 7, 4};
Number[] series2Numbers = {4, 6, 3, 8, 2, 10};
Raj
  • 22,346
  • 14
  • 99
  • 142
Girish
  • 123
  • 1
  • 4
  • 14

1 Answers1

1

fetch the data and store in an Int[] and then pass this int array wherever you are using series1Numbers and series2Numbers because the Number class is nothing but an int array.

Sujit
  • 10,512
  • 9
  • 40
  • 45
  • 1
    I would like to display month names in y-axis how can i do that, i am able to pass x-axis data as you said by fetching and passing to int array. – Girish May 14 '11 at 00:55
  • I can do that as following.. mySimpleXYPlot.setDomainLabel("Months"); mySimpleXYPlot.setRangeLabel("Expenses"); – Girish May 14 '11 at 01:45
  • A bit late to the party, but since I was experiencing the same problem myself today, I'm linking to it for future reference: http://stackoverflow.com/questions/10770220/androidplot-setting-the-labels-on-the-x-axis/10770857#10770857 – gleerman May 27 '12 at 00:50