I'm using the pChart library and I want to have a X scale of 1-100 but on the chart I want to have divisions in multiples of 10. I have 2000 data points.
Unfortunately my axis X is not readable, as the |
is placed at every axis unit, rather than every 10. Now it looks like this - any ideas?
Edit: after using @EPICWebDesign tip i got
How to remove duplicate X
values. I can do array_unique
but then i lose some points on chart.
If this is pChart 2, you can use the LabelSkip setting.
ie: "LabelSkip"=>$X,
will make it show only each $X th label, while still showing all of the data points.
From the wiki: You can skip specified number of X labels using LabelSkip. http://wiki.pchart.net/doc.doc.draw.scale.html
You can make the duplicate x axis values null. See PHP: duplicate value removal
Here is a more specific example:
$x = array(1,1,2,3,4,5);
$prev = -1;
foreach ($x as &$point) {
if ($prev === $point) {
$point= NULL;
}
else {
$prev = $point;
}
}
unset($point);
print_r($x); // 1,NULL,2,3,4,5...