shuaiwangVM / achartengine

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

duplicate x values behavior in XYSeries #477

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an XYSeries (called series)
2. add a point (1.0, 1.0)
3. add a point (1.0, 2.0)
4. print series.getX(series.getItemCount() - 1) 
series.getY(series.getItemCount() - 1)

What is the expected output? What do you see instead?
The expected output is (1.0, 2.0). Instead, I see (1.0000000002, 2.0). 

Please provide a source code snippet that we can use to replicate the
issue.

XYSeries series = new XYSeries("series");

series.add(1, 1);
series.add(1, 2);

int index = series.getItemCount() - 1;

System.out.println(series.getX(index) + " , " + series.getY(index));

What version of the product binary library are you using?
1.2.0

Please provide any additional information below.
If I attempt to add two points with the same value for x to an XYSeries, the 
second x value is adjusted so that it is slightly greater than the intended 
value.

ex: if I add (1.0, y1) and (1.0, y2) the XYSeries stores the second point as 
(1.00000002, y2)

I am not sure if this behavior is intentional, because obviously a function 
can't map the same domain value to two separate range values. However, I am 
using your chart engine for graphing discrete sets of data, so I would like to 
be able to create 2 or more points with the same x value.

Original issue reported on code.google.com by sweidenk...@gmail.com on 10 Apr 2015 at 5:51