Altro
Altro

Reputation: 938

How to remove series value from hover tooltip apex charts pie

enter image description here

I want to just remove the number 33 from this, I want it to just show series-4

enter image description here

what to do to hide it from tooltip?

Upvotes: 3

Views: 10712

Answers (3)

Shurvir Mori
Shurvir Mori

Reputation: 2417

Just add name:"", here is sample code,

series: [{
    name: "",
    data: [{
        x: "2018-09-10",
        y: 120
      }, {
        x: "2018-09-11",
        y: 480
      }]
    }
] 

Upvotes: 1

Fringley
Fringley

Reputation: 906

Try changing the tooltips options to:

tooltip: {
  enabled: false
}

That did the trick for me.

Upvotes: 2

Oscar Schafer
Oscar Schafer

Reputation: 1535

You can customize the tooltip by providing formatters. In this case, you'll want to override both the title (seriesName) and the y value label. In place of the y value, return a blank string.

You'll need to provide a formatter for the title as well because not doing so will default to the series title being shown followed by a colon.

  tooltip: {
    y: {
      formatter: function(val) {
        return ''
      },
      title: {
        formatter: function (seriesName) {
          return seriesName
        }
      }
    }
  }

Upvotes: 10

Related Questions