Home Forums Chart Support No Axis no grid

No Axis no grid

Viewing 2 posts - 1 through 2 (of 2 total)
  • #40019

    Hello everyone!
    I would like to have a bar chart, with the index inside the bars and no axis, legends, girds, or background.

    I cant remove the axis with its labels at the moment and need help!

    Thank you!

    #40028

    @oberfreak,

    You can hide grids, ticks & axis lines by setting gridThickness, tickLength and lineThickness properties to 0. Please find the code-snippet below.

    axisX:{
       gridThickness: 0,
       tickLength: 0,
       lineThickness: 0
    },
    axisY:{
       gridThickness: 0,
       tickLength: 0,
       lineThickness: 0
    },

    If you like to show axis labels inside the bar, you can do so by using labelPlacement property. Please take a look at this gallery page for an example on the same. However, if your requirement is to completely hide the axis labels & use indexlabels, you can use labelFormatter to do so. Below is the code snippet for the same.

    axisX: {
        labelFormatter: function(e) {
            return "";
        }
    }

    Please take a look at this JSFiddle for an example on sparkline chart. Also, take a look at this Github repo for a plugin that ease your task.
    Chart with Hidden Axis Grids, Ticks, Line & Labels - SparkLine Chart


    Vishwas R
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.