Chart.js - Callback to make a point active

Viewed 844

I'm trying to navigate radar's graph point with the rotating bezel on watch and have stacked for several days on this:

A) Via click on graph

  1. Select point (mark blue)
  2. Write value to a HTML element

B) Via callback (inner circle in this sample)

  1. Navigate the point +1 / -1 from A1
  2. Write value to a HTML element (how to retrieve info from tooltip here?)

I have a trouble with B. In my case, B1 is navigating through points, but it doesn't mark the point with blue circle. It is also possible to show tooltip here correctly, but it doesn't write to HTML element like A1 does.

Can you help me please with B1 and B2 please? It's at the end of JS file in Fiddle sample - https://jsfiddle.net/Konvas/aqyrsxL3/22/

function updateView() {
  chart.tooltip._active = [chart.getDatasetMeta(currentDatasetIndex).data[currentPointIndex]];
  console.log(chart.tooltip);
  chart.tooltip.update();
  chart.update();
}

Thanks!

0 Answers
Related