paragp / achartengine

AChartEngine is a charting library for Android applications. It currently supports the following chart types: line chart area chart scatter chart time chart bar chart pie chart bubble chart doughnut chart range (high-low) bar chart dial chart / gauge combined (any combination of line, cubic line, scatter, bar, range bar, bubble) chart cubic line chart All the above supported chart types can contain multiple series, can be displayed with the X axis horizontally (default) or vertically and support many other custom features. The charts can be built as a view that can be added to a view group or as an intent, such as it can be used to start an activity. The model and the graphing code is well optimized such as it can handle and display huge number of values. AChartEngine is currently at the 1.0.0 release. New chart types will be added in the following releases. Please keep sending your feedback such as we can continually improve this library. Find us on Facebook, too: http://www.facebook.com/achartengine Read a short introduction to AChartEngine here: http://www.javaadvent.com/2012/12/achartengine-charting-library-for.html Another good tutorial can be read here: http://jaxenter.com/effort-free-graphs-on-android-with-achartengine-46199.html
0 stars 1 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