1

In v2.0-beta, is there a way to configure the tooltip corresponding to that x-position to show up when hovering anywhere above that point on the axis? for example, the functionality shown here: https://blockchain.info/charts/market-price

As you trace the line horizontally, you are shown the tooltip corresponding with your distance from the y-axis.

biode
  • 21
  • 1

1 Answers1

0

What the tooltip shows in your example is the y value corresponding to the distance from the y-axis (i.e. the x value).

Unless you want to extrapolate between data points (not usually a good idea for data like that shown in your example, since you don't know that its going to follow your extrapolation), this means that you need to have data values for all points where you want to show the tooltip.

With that your question is basically about showing every n x axis labels. https://stackoverflow.com/a/31606933/360067 does this similar for the current stable version of Chart.js. For v2.0-alpha, the option you need to be adjusting is scales.xAxes.labels.template.

Community
  • 1
  • 1
potatopeelings
  • 40,709
  • 7
  • 95
  • 119