Hello,
i would like to use the plottype 'linepoints'.
For example i have three values: 3,6,10.
PHPlos shows the lower values at the bottom of the y-axis, and the upper values on the top (default behaviour).
But what i need is to reverse/invert the behaviour. This mean: the value 10 is near the bottom, and the value 3 is on the top.
Is it possible?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PHPlot does not directly support reversing the Y axis, unfortunately. However, there is a way to get similar results that might work for you. Take a look at this post in the forum, and see if that helps. There is a complete short script example too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Changing data type from data-data to text-data tells PHPlot that your data array rows do not have X values. PHPlot then sees your array rows as having an empty label and 2 Y values: 19.08 and 8 for the first row. So you got 2 line plots for the 2 Y values per X. Not what you want.
To get date values along X, you have 2 choices: (1) You can put the dates into the label positions of the array: array('19.08', 8), ... and use the data type text-data (with X data labels on, X tick labels off). You will get uniformly spaced points (not spaced according to the actual date intervals), with those exact labels along the X axis.
Or (2) you can use data type data-data, with data array rows like ('', $x, $y), but the X values in the array have to be represented as PHP timestamp values (integer seconds since the epoch). Then you use SetXLabelType('time', ...) to tell PHPlot to format the X values as dates. Unlike the above, your values will be spaced out proportionaly to the actual dates in this case.
I think there are other ways to do this too, with a custom label function for X.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
i would like to use the plottype 'linepoints'.
For example i have three values: 3,6,10.
PHPlos shows the lower values at the bottom of the y-axis, and the upper values on the top (default behaviour).
But what i need is to reverse/invert the behaviour. This mean: the value 10 is near the bottom, and the value 3 is on the top.
Is it possible?
PHPlot does not directly support reversing the Y axis, unfortunately. However, there is a way to get similar results that might work for you. Take a look at this post in the forum, and see if that helps. There is a complete short script example too.
Thanx for the script (it does work almost), but there is still a problem:
On the x-axis it should not be displayed integers from 1-10, but a date (19.08. ..... 22.08. ..... 27.08 .....)
So i have changed the code
$plot->SetDataType('data-data');
to
$plot->SetDataType('text-data');
My source is:
$data = array(
array('', '19.08.', 8),
array('', '22.08.', 6),
array('', '25.08.', 5),
);
Nevertheless on the x-axis i see 1,2,3,... and not 19.08,22.08,25.08, .... why?
Besides there are two linepoints in the diagramm (instead of one). why?
Changing data type from data-data to text-data tells PHPlot that your data array rows do not have X values. PHPlot then sees your array rows as having an empty label and 2 Y values: 19.08 and 8 for the first row. So you got 2 line plots for the 2 Y values per X. Not what you want.
To get date values along X, you have 2 choices: (1) You can put the dates into the label positions of the array: array('19.08', 8), ... and use the data type text-data (with X data labels on, X tick labels off). You will get uniformly spaced points (not spaced according to the actual date intervals), with those exact labels along the X axis.
Or (2) you can use data type data-data, with data array rows like ('', $x, $y), but the X values in the array have to be represented as PHP timestamp values (integer seconds since the epoch). Then you use SetXLabelType('time', ...) to tell PHPlot to format the X values as dates. Unlike the above, your values will be spaced out proportionaly to the actual dates in this case.
I think there are other ways to do this too, with a custom label function for X.