3

How can I set the tickInterval in x-axis for a jqplot.CanvasAxisTickRenderer ? The x-axis labels are strings.

I try the code below, but it does not work. Help please, thanks.

xaxis: {
        tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
         tickOptions: {
             angle: -90,
             fontSize: '12pt'
         },
         tickInterval : 10,
         renderer: $.jqplot.CategoryAxisRenderer,
         ticks: ticks,
         label: '<%= chartBy.replace("_", " ").toUpperCase()%>',
         labelOptions:{
              enableFontSupport:true,
              fontFamily:'Verdana',
              fontSize: '12pt'
         }
Ianthe
  • 5,559
  • 21
  • 57
  • 74

1 Answers1

13

The property tickInterval is a string field. Try setting it like this:

xaxis:{
//Other options
tickInterval: '1 day',
//Another options
}

I've searched another options and these are the ones i've tested (they work):

  • '1 day'
  • 'x days' where x is any integer greater than 1
  • '1 week'
  • 'x weeks' where x is any integer greater than 1
  • '1 month'
  • 'x months' where x is any integer greater than 1

Note that these are case-sensitive options. So, 'month' is different than 'Month'.

AdrianoRR
  • 1,131
  • 1
  • 17
  • 36