jqPlot custom tick labels

HiveHicks picture HiveHicks · Feb 13, 2012 · Viewed 12.5k times · Source

I've got data with X values from 0 to 55. I would like to see these values as a custom text in tick labels. Ideally, I want to specify some callback, like

function tickLabel(tickValue) {
    return "This is " + tickValue;
}

Is it possible?

Answer

HiveHicks picture HiveHicks · Feb 13, 2012

I've found a solution.

xaxis: {
  tickRenderer: $.jqplot.AxisTickRenderer,
  tickOptions: {
    formatter: function(format, value) { return "This is " + value; } 
  }
}