Zelter Ady
Zelter Ady

Reputation: 6348

jqplot axis short numbers as ticks values

I have an issue with a jqplot graph. The issue is that ticks numbers are overlapped:

enter image description here

I'd like to find a way to fix this. I thought of these two:

  1. Short the numbers displayed on xAxis like by dividing with 1000 and display each number like 1k, 3k ... etc
  2. Skip some ticks, I don't need to see all the ticks if more than 5 ticks.

I prefer the first way [the k shorter] but I'm open to any solution that can make the graph looks better.

Upvotes: 0

Views: 99

Answers (1)

user4522781
user4522781

Reputation:

Reduce the ticks by giving fix intervals like 1k 3k 5k.Here is a piece of code.

xaxis:{                     
                  min: 0,
                  max: 24,
                  ticks: ['0','1', '2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24'],
                  label:'Hours', 
                  labelRenderer: $.jqplot.CanvasAxisLabelRenderer
              },

Upvotes: 2

Related Questions