I'm plotting a graph with line and points. Above the point the value is printed,
I want to not display the value of the data, when it's 0(zero). Did someone already have tried something like this?
When I use the type line and the X axis doesn't have much space between each item the values inside the graph overlap themselves.
Sorry, a correction: What I posted above, using SetYLabelType() will affect both Y tick labels (those on the axis), and Y data labels (those within the plot). The unwanted side effect would be no 0 label on the Y axis. I should have said to use this:
$plot->SetYDataLabelType('custom', 'my_format');
Which only applies to the Y data labels (inside the plot area).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm plotting a graph with line and points. Above the point the value is printed,
I want to not display the value of the data, when it's 0(zero). Did someone already have tried something like this?
When I use the type line and the X axis doesn't have much space between each item the values inside the graph overlap themselves.
You can take a look at http://imageshack.us/f/826/graficoe.png/
Best Regards,
Guilherme
Last edit: Guilherme 2013-06-05
You can do this with a custom label formatting function. Define your function to return an empty string if you do not want that value labeled:
Now tell PHPlot to use your function to format the Y data labels:
More about this here with a longer example here
Perfect man!
Thank you!
Sorry, a correction: What I posted above, using SetYLabelType() will affect both Y tick labels (those on the axis), and Y data labels (those within the plot). The unwanted side effect would be no 0 label on the Y axis. I should have said to use this:
Which only applies to the Y data labels (inside the plot area).