Ask Your Question
0

How can tooltips be displayed in progress bars of Highcharts?

asked 2023-04-01 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-11-09 19:00:00 +0000

scrum gravatar image

Tooltips can be displayed in progress bars of Highcharts using the following steps:

  1. Set the tooltip property of the chart to true to enable tooltips.
  2. Set the formatter property of the tooltip to a function to customize the tooltip content.
  3. In the function, use the this.point object to access the data point associated with the progress bar and display the desired information.
  4. Set the pointFormat property of the tooltip to format the tooltip content.

Here is an example code snippet:

Highcharts.chart('container', {
  chart: {
    type: 'bar'
  },
  title: {
    text: 'Progress bars with tooltips'
  },
  yAxis: {
    min: 0,
    max: 100,
    title: {
      text: 'Percentage'
    }
  },
  series: [{
    name: 'Progress',
    data: [75, 40, 60],
    tooltip: {
      enabled: true,
      pointFormat: '{point.y}%'
    }
  }],
  tooltip: {
    formatter: function() {
      return this.point.y + '% complete';
    }
  }
});

This will display tooltips when the user hovers over the progress bars, showing the percentage complete.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-04-01 11:00:00 +0000

Seen: 7 times

Last updated: Nov 09 '22