Ianthe
Ianthe

Reputation: 5709

JQuery : TickInterval in JQPlot

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'
         }

Upvotes: 3

Views: 17693

Answers (1)

AdrianoRR
AdrianoRR

Reputation: 1131

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'.

Upvotes: 13

Related Questions