hochileo / achartengine

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

[Enhancement] Add User Defined Y Grid #194

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Decorate the graph with user defined grid with dedicated look'n feel
(title, color, ....)

What steps will reproduce the problem?
n/a

What is the expected output? What do you see instead?
Horizontal lines on top of the default grid

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

renderer.addUserYGrid(new UserYGrid("Freezing",0.0, 
Color.BLUE,BasicStroke.DASHED));
renderer.addUserYGrid(new UserYGrid("Boiling",100.0, 
Color.BLUE,BasicStroke.DASHED));
renderer.setShowUserYGrid(true); 

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

Please provide any additional information below.
The code attached is up and working, was done on top of the version 0.7.0 - 
uploaded on March, 9th albeit I am not sure about the
maxScaleNumber part ... see XYChart
../...
     for (int i = 0; i < maxScaleNumber; i++) {
        // @TODO likely to be for multi axes .. do no handle it yet ....

Original issue reported on code.google.com by jc.pazza...@gmail.com on 12 Mar 2012 at 10:03

Attachments:

GoogleCodeExporter commented 9 years ago
even for the original library, the grid messes up once you have more than one 
axis. Is there any workaround for that?

Original comment by subayya...@gmail.com on 20 Mar 2012 at 2:51

GoogleCodeExporter commented 9 years ago
In patch format done on top of 1.0.0

Original comment by jc.pazza...@gmail.com on 4 Apr 2012 at 6:47

Attachments:

GoogleCodeExporter commented 9 years ago
Can you tell me how I use this patch? Another enhancement would be the same 
funtionality for the X-axis...

Original comment by jeens...@gmail.com on 4 May 2012 at 7:11

GoogleCodeExporter commented 9 years ago
1 -patch the code (from 1.0.0)
2 -genereate a new jar
3 - modify the renderer as explained
renderer.addUserYGrid(new UserYGrid("Freezing",0.0, 
Color.BLUE,BasicStroke.DASHED));
renderer.addUserYGrid(new UserYGrid("Boiling",100.0, 
Color.RED,BasicStroke.DASHED));
renderer.setShowUserYGrid(true);

voila !

Original comment by jc.pazza...@gmail.com on 7 May 2012 at 2:15

GoogleCodeExporter commented 9 years ago
A few comments about the provided patch:
* what is line #44?
* Why does GraphicalView return a reference to the chart?
* This is an XY charts specific feature. Why is this stuff set in the 
DefaultRenderer instead of XYMultipleSeriesRenderer?
* Why is the code less documented than the main ACE code?

Original comment by dandrome...@gmail.com on 12 May 2012 at 11:43

GoogleCodeExporter commented 9 years ago
Instead of adding new code, you can do this with the existing APIs. Example:
renderer.setShowCustomTextGrid(true);
renderer.addXTextLabel(7.5, "");
renderer.addYTextLabel(7.5, "");

Original comment by dandrome...@gmail.com on 16 Jun 2012 at 2:01