0
votes

I am trying to create Highchart, where I want to format the legend. Documentation says - "Callback function to format each of the series' labels. This keyword refers to the series object or the point object in case of pie charts. By default, the series or point name is printed."

But when we try to use it it gives an error - "Highchart property 'name' does not exist on type 'LegendOptions'"

Code -

legend: {
  itemWidth: 150,
  itemMarginTop: 20,
  symbolPadding: 20,
  symbolRadius:200,
  labelFormatter: function () {
    return (this.name + '(Click Here)');
  }

Any input on the same?

1
Can you share the fiddle link here?Gaurav Neema
Could you reproduce this issue in an online code editor like jsfiddle or codesandbox? Do you use any framework?Wojciech Chmiel
Its working fine for me. jsfiddle.net/vnmfr806Ashu

1 Answers

0
votes

So I figured it out but forgot to post here. The following works for me

labelFormatter: function () {
return ((this as Point).name+ '(Click Here)');

}