JqPlot: hide axis ticks?

Here's the default jqPlot axis with ticks:

with ticks

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

without ticks

I want to display numbers and hide ticks - small strokes between numbers and a thick axis. Is it possible?

+5
source share
2 answers
axesDefaults: {
   showTickMarks:false
}

showTicks toggles cue marks and cue tags, and showTickMarks toggles cue tags only.

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

EDIT: I mistakenly found showTicks in a piece of code that I fixed.

+6
source

Not sure if the wireframe has changed since the answer, but that didn't work for me.

( , , axesDefaults).

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

0

All Articles