yunjianwu / achartengine

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

Single point values don't display text, just the point #349

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Add a single point or a series whith "holes", leaving a point alone

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

The expected output would be that even the single point has a text value.
Instead, a single point is displayed only as a point. Withouut any text.

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

What version of the product binary library are you using?

1.1.0

Please provide any additional information below.

This would be really an easy fix, I guess (like the one of changing values text 
color). Especially for an excellent programmer as Dan.

Original issue reported on code.google.com by luca.cri...@gmail.com on 10 Sep 2013 at 8:09

GoogleCodeExporter commented 9 years ago
Hi Luca, I have the same problem and I patch XYChart (I do have a project fork 
so i can change source code and/or implement new features).

I change the method :

protected void drawChartValuesText(Canvas canvas, XYSeries series, 
SimpleSeriesRenderer renderer,
      Paint paint, List<Float> points, int seriesIndex, int startIndex) {
    if (points.size() > 1) { // there are more than one point

to protected void drawChartValuesText(Canvas canvas, XYSeries series, 
SimpleSeriesRenderer renderer,
      Paint paint, List<Float> points, int seriesIndex, int startIndex) {
    if (points.size() > 2) { // there are more than one point

In fact both x and y are stored in the same XYSeries that means if the series 
size is 2 there is only 1 points, not 2... 

Attach is a diff patch file to be applied on XYChart.java or directly change in 
source code.

Regards, 
Matthieu

Original comment by milou68 on 1 Oct 2013 at 9:46

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dandrome...@gmail.com on 8 Jan 2014 at 3:48