0
votes

I'm using jQuery Flot Charts in one of my projects and it works great. However the thing is that my x-axis has a lot of ticks (around 72) and I want to hide the labels for some of them keeping the ticks intact so just the dots on the line chart are visible. I've read the documentation and tried a lot of things (min, max, minTickSize, maxTickSize, etc.) but don't seem to find a solution.

Thanks.

1
Please show your data and code. The options from the documentation should work (except for maxTickSize, there is no such option).Raidri
Could you please be a little bit more precise on which options should work? The key thing to consider is that the ticks in my case is an array. My guess is that Flot is designed to show all of the ticks from that array and there's no way to make it show only some amount.cycero
Correct, if you specify a ticks array, all of that array is used. Try to remove every second entry from the array or something similar.Raidri

1 Answers

0
votes

I solved this by simply using the modulo operation when creating the xticks array as follows:

...
if(i%2 == 0)
{
    xticks.push([i, "|"]);
} else {
    xticks.push([i, "<?php echo $set['polldate'] ?>"]);
}
...

This puts a pipe for every other tick. Or just use a space (example): enter image description here