Home Forums Chart Support Hide axis label

Hide axis label

Viewing 6 posts - 1 through 6 (of 6 total)
  • #19815

    Hi,

    I am using this https://canvasjs.com/jquery-charts/column-chart/ . Is there anyway to hide the label, because I had about 22 bars to create for this chart. And the label unable to fit. I only want to remain the mouse over label.

    #19822

    @9mthsnafter,

    You can use labelFormatter to hide axis-labels. You can use tickLength and lineThickness to hide tick and axis-lines respectively. Below is the code-snippet.

    axisX:{
        gridThickness: 0,
        tickLength: 0,
        lineThickness: 0,
        labelFormatter: function(){
          return " ";
        }
      },
      axisY:{
        gridThickness: 0,
        tickLength: 0,
        lineThickness: 0,
        labelFormatter: function(){
          return " ";
        }
      },

    Please take a look at this JSFiddle for complete code.
    chart with hidden axis and gridlines - sparkline chart


    Vishwas R
    Team CanvasJS

    #23268

    Is it possible to hide the axis label but still display a crosshair label?

    I’ve forked your fiddle to include a crosshair but it seems the axis labelFormatter overrides the crosshair’s labelFormatter.

    http://jsfiddle.net/elcollie/5bn638gh/

    • This reply was modified 6 years, 1 month ago by elcollie.
    #23273

    @elcollie,

    Thanks for reporting the use-case. We will look into the issue and fix it in future versions.

    To work-around this issue, you can set axis labelFontColor to “transparent” instead of using labelFormatter to hide the axis labels. Please take a look at this updated JSFiddle.

    chart showing crosshair but hidden axis


    Vishwas R
    Team CanvasJS

    #23279

    Works like a charm!

    Thanks!

    #30493

    [UPDATE]

    We have just released v3.0 Beta-1 with this improvement. Please refer to the release blog for more information. Do download the latest version from download page & let us know your feedback.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.