Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in TimeChart with conversion long -> double -> long #7

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 4 comments
Closed

Comments

@GoogleCodeExporter
Copy link

Bug is in conversion long -> double -> long. The first one is in 
TimeSeries.add(), the second one stays in TimeChart.drawXLabels().
Because of trimming of numbers sometimes it is impossible to restore Date 
class to draw labels.

Original issue reported on code.google.com by el.vo...@gmail.com on 1 Jun 2010 at 8:16

@GoogleCodeExporter
Copy link
Author

Can you please provide a code snippet such as we can replicate this?

Thanks,

Dan

Original comment by dandrome...@gmail.com on 21 Jun 2010 at 6:23

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

If this is the same issue as the one I am having, then this means the following 
method:

org.achartengine.chart.XYChart.getLabel(double)

uses the double value to draw the label. But for a TimeSeries, you want to draw 
a java.util.Date label, not a double label. The mismatch between a double and a 
long in the method:

org.achartengine.model.TimeSeries.add(Date, double)

means that you may lose some precision when trying to convert the double back 
to a Date in the previously metioned 
"org.achartengine.chart.XYChart.getLabel(double)" method. You do this to 
convert the double back to a Date, as you want to display a Date label.

Is there any other way of registering a "LabelProvider" that the chart 
delegates to when creating appropriate labels for the chart? Something like:

interface LabelProvider {
  String getLabel(Series series, int index);
}

Original comment by PaulGr...@gmail.com on 25 Jul 2010 at 9:10

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Please provide some code snippet that will help me replicate the problem.
Currently, I cannot replicate this and I also don't imagine why there could be 
loss of data while converting between long and double.

Original comment by dandrome...@gmail.com on 16 Nov 2010 at 5:31

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by dandrome...@gmail.com on 3 Jan 2011 at 2:13

  • Changed state: Invalid
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant