I have a lineGraph with float values on both x-axis and y-axis? My question is that how can i set String values on x-axis like date or name of months.I am using GraphView-3.0.jar library.my code is
values_list.add(1.0);
values_list.add(5.0);
values_list.add(9.0);
values_list.add(12.0);
values_list.add(17.0);
values_list.add(1.0);
values_list.add(13.0);
values_list.add(23.0);
graphData = new GraphViewData[(values_list.size())];
double price_copy = 0;
for (int i = 0; i < values_list.size(); i++) {
price_copy = values_list.get(i);
graphData[i] = new GraphViewData(i, price_copy);
}
GraphView graphView;
graphView = new LineGraphView(this // context
, "" );// graphView.addSeries(exampleSeries);// data
graphView.addSeries(new GraphViewSeries("values",
new GraphViewStyle(Color.rgb(00, 00, 128), 3),
graphData));
graphView.setShowLegend(true);
// set view port, start=2, size=40
graphView.setViewPort(0, 10);
graphView.setScalable(true);
graphView.setScrollable(true);
LinearLayout layout = (LinearLayout) findViewById(R.id.LNL_CHART);
layout.addView(graphView);
Also i have no idea about AchartEngine,thanks in advance.
Use achart engine library. you can search for that on google. it helped me.Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With