bjjrolls
bjjrolls

Reputation: 549

How to edit tooltip in Highcharts C# code

I have a Highchart basic bar graph that I want to edit the tooltip for.

Basically as it stands when I hover over the bars it gives me the percentage values that I coded in (in the seriesData)

What I want is to be able to use a Count as well. I've seen the

.SetToolTip(new Tooltip {
    Shared = true,
    Formatter = @"function() { return this.whatever; }
}

possibly used to this effect, but I don't know what this refers to, or how to plug in my own variables from C# code.

Upvotes: 2

Views: 489

Answers (1)

JJG
JJG

Reputation: 49

Formatter = { headerFormat = "<b>{series.name} </b> <br>", pointFormat = "<b>{point.y:,.0f}%</b>" }

You need to add properties that are needed inside your formatter. headerFormat is use mostly for the title of your widget(eg. Drug name, City etc.) pointFormat this will be the return string/number upon hovering specific widget. Please see the sample here.

Upvotes: 1

Related Questions