wangyao5 / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

Misalignment of X values, when min/max set for one XY series #264

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a 2 sets of XY data, with the X array equal in both
2. Use function render.setChartSettings(...) as in AbstractDemoChart
3. Add data

What is the expected output? What do you see instead?

I expect two curves, where every X point is aligned. Instead I see that the 
software scales one curve based on min and max set by setChartSettings, and 
calculates the other in onDraw.

See image. One plot is current for every voltage point, other plot is power for 
every voltage point (P=IV), so the two plots should line up.

Note, I fixed my issue by not setting min and max, but it is surprising to see 
data graphed that doesn't match the X axis!

What version of the product binary library are you using?
Checked out Revision 467.

Original issue reported on code.google.com by john.c.m...@gmail.com on 10 Jan 2013 at 3:36

Attachments:

GoogleCodeExporter commented 9 years ago
You can fix this in two ways:
1. Don't call setChartSettings because that calls setXAxisMin and setXAxisMax 
for the first scale only.
or
2. Call setXAxisMin(minValue, 1) and setXAxisMax(maxValue, 1) with min and max 
values being the same as in setChartSettings.

Original comment by dandrome...@gmail.com on 10 Jan 2013 at 6:39

GoogleCodeExporter commented 9 years ago
Workaround #1 worked for me. But it still seems like a bug that the x axis 
values are only correct for one of the curves! As the user of the graph, I 
assume the x axis values apply to both. 

It seems like the rendering algorithm should that there is only one x-axis, 
since only one is displayed.

Original comment by john.c.m...@gmail.com on 10 Jan 2013 at 6:45