-1

i am testing the latest jar of achartengine and im wondering if i am doing something wrong. here is the values i want to plot.

int[] y =  {73,92,83}; // y values!
int[] x =  {1,1,1};

This should plot as a vertical line because all the x axis plots are the same only the y axis values are changing. But instead it plots a near horizontal line with all the x axis values not matching the relevant labels. Is there a way i can fix this so that the graph plots accuratley

user2608169
  • 145
  • 3
  • 13

1 Answers1

0

The only values you have in the graph are rendered at X = 1. I suggest you either add another series that has values across the X axis or you do a:

renderer.setXAxisMin(0);
renderer.setXAxisMax(2);
Dan D.
  • 32,246
  • 5
  • 63
  • 79
  • hi Dan i did what you said where i applied a max and min for the x axis and it still plots the graph points incorrectly when it should plot on the same point.I dont think the previous achartengine jars did that. i would use the older jars but there are certain customizations that the latest jar allows me to do that i really need. Can you help me because i dont see why i should have to create more values for the x axis when the values were 1,1,1 and it should plot all the y values wethere they change or not on the same line for the x axis and it doesnt.can you help me please – user2608169 Jul 25 '13 at 10:22
  • That's what it should do, but it doesn't because there were some performance improvements at some point. The internal model changed from lists to maps and maps with X being the keys. You probably know you cannot have several values with the same key in the map. This is why I suggest you add more data. AChartEngine is not for displaying vertical lines only. – Dan D. Jul 25 '13 at 10:31
  • Ok then well since i require the list version as i want it so that if i plot the values y={1,2,3,4} and x={1,1,2,3} it plots a lowercase r shape not a rising line. so which version of achartengine will do this but also allow me to setYLabelsPadding aswell? – user2608169 Jul 25 '13 at 10:46