5

Here's a default jqPlot axis with ticks:

with ticks

Setting "showTicks: false" on the x-axis removes everything:

without ticks

I want to display the numbers and hide the ticks - the little dashes between the numbers and the thick axis line. Is this possible?

John Slegers
  • 45,213
  • 22
  • 199
  • 169
Ollie Glass
  • 19,455
  • 21
  • 76
  • 107

2 Answers2

8
axesDefaults: {
   showTickMarks:false
}

showTicks toggles the tick marks and the tick labels, and showTickMarks toggles only the tick marks.

Check out the options at: http://www.jqplot.com/docs/files/jqPlotOptions-txt.html

EDIT: I mistakenly had showTicks in the code snippet, which I fixed.

reckbo
  • 302
  • 4
  • 13
0

Not sure if the framework changed since this answer but it didn't work for me.

Here's what did (I left all the fluff so you can see where the axesDefaults live).

var plot1 = $.jqplot ('chart1', [line1, badLine], {
    title:'Data Point Highlighting',
    axesDefaults:{
        tickOptions:{
            showMark: false
        }
    },
    axes:{
        xaxis:{
            tickInterval:1,
            min:0.5,
            ticks: [[0.5,""],[1,"1"],[2,"2"],[2.5,""]]
        },
        yaxis:{
            ticks: [['25', ""], ['24', "12am"], ['22', "2am"], '20', '18', ['16',"4pm"], '14', '12', '10', '8', '6', '4', '2', '0'],
            min:0,
            max:24,
        }
    },
    series:[
        {
            showLine: false
        },
        {
            showLine: false,
            markerOptions: { style:"x" }
        }
    ],
    highlighter:{
        show: true,
        sizeAdjust: 7.5
    },
    cursor:{
        show: false
    }
});

http://www.jqplot.com/docs/files/jqplot-core-js.html#jqPlot.axesDefaults

Olmstov
  • 563
  • 7
  • 18