When I tried your script (without SetYDataLabelPos, and with a made-up data
array), I get Y axis labels from 0 to 100 in steps of 10. This is the default
behavior. What do you expect to see, and what exactly are you seeing? (I know
this is dumb, but we are talking about the labels along the vertical axis,
right?)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, sorry I missed that, the title was correct ("Y data labels") but you
mentioned Y axis labels so I thought you meant those.
Yes, SetYDataLabelPos('plotin') will turn on the "Y data value labels", which
labels each data point within the plot area. This was first implemented for
lines, linepoints, and points plots in PHPlot-5.3.0 (released in December
2010), so the first thing to check is that you are using PHPlot 5.3.0 or
newer.
There is an example of a linepoints plot with Y data value labels is in the
manual (note
this example also turns off Y axis labels and turns on data label lines, but
you don't have to do that to make the Y data value labels work). You might
want to copy and paste that from the manual and see if it works for you. If
that still doesn't help, can you try to reduce your code to a stand-along
script that I can run?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
New to this forum so not sure how to initiate a question, also new to PHPlot
but making good progress. What I am trying to do is to present Y data labels
on top of my bars in a bar chart, BUT only for the latest of the three bars in
each series, leaving the first two clear. At the moment I can only have all 3
labels, using $plot->SetYDataLabelPos('plotin'); or none. Does anyone know of
a way, please. Very grateful of any help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i am struggling to add y axis labels to a line graph.
so far i have
$legend_text = array('All', '0-2d', '2-4d', '4-7d', '7-16d');
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain'); // Improves presentation in the manual
$plot->SetTitle("Llanbedr, West Wales GFS snow index");
$plot->SetDataType('text-data');
$plot->SetDataValues(read_prices_text_data(DATAFILE));
$plot->SetPlotType('linepoints');
$plot->SetDataColors(array('red', 'green', 'blue', 'black', 'orange'));
$plot->SetLegend($legend_text);
$plot->SetLegendWorld(0.1, 22);
$plot->SetXLabelAngle(90);
$plot->SetXTickPos('none');
$plot->SetPlotAreaWorld(NULL, 0, NULL, 100);
$plot->SetLineStyles('solid');
$plot->SetLineWidths(2);
$plot->DrawGraph();
and have tried adding
$plot->SetYDataLabelPos('plotin');
with no luck.
any ideas?
by the way the graph plots fine apart from the y axis labels.
When I tried your script (without SetYDataLabelPos, and with a made-up data
array), I get Y axis labels from 0 to 100 in steps of 10. This is the default
behavior. What do you expect to see, and what exactly are you seeing? (I know
this is dumb, but we are talking about the labels along the vertical axis,
right?)
I actually meant the y data labels next to the data points on the graph
itself.
how do I add those?
OK, sorry I missed that, the title was correct ("Y data labels") but you
mentioned Y axis labels so I thought you meant those.
Yes, SetYDataLabelPos('plotin') will turn on the "Y data value labels", which
labels each data point within the plot area. This was first implemented for
lines, linepoints, and points plots in PHPlot-5.3.0 (released in December
2010), so the first thing to check is that you are using PHPlot 5.3.0 or
newer.
There is an example of a linepoints plot with Y data value labels is in the
manual (note
this example also turns off Y axis labels and turns on data label lines, but
you don't have to do that to make the Y data value labels work). You might
want to copy and paste that from the manual and see if it works for you. If
that still doesn't help, can you try to reduce your code to a stand-along
script that I can run?
BINGO!
i upgraded to 5.6.0 and the plots work a treat!
thanks for your help !
New to this forum so not sure how to initiate a question, also new to PHPlot
but making good progress. What I am trying to do is to present Y data labels
on top of my bars in a bar chart, BUT only for the latest of the three bars in
each series, leaving the first two clear. At the moment I can only have all 3
labels, using $plot->SetYDataLabelPos('plotin'); or none. Does anyone know of
a way, please. Very grateful of any help.
FYI, on the top-level view of this discussion forum, at the bottom of the page
under Add a Topic, is where you can start a new thread.
I copied your post to a new thread here: https://sourceforge.net/projects/php
lot/forums/forum/46382/topic/5009239 to avoid confusion.