U
U
uRoot2021-06-24 16:14:27
React
uRoot, 2021-06-24 16:14:27

How do I draw an arbitrary line in Chart.js?

You need to draw lines on the chart and put text. I try like this:

useEffect(() => {
    // @ts-ignore
    var ctx = document.querySelector(".chartjs-render-monitor").getContext("2d");

    ctx.fillText('Рандомный текст', 12, 15);
  }, [])


But if I hover over the graph, then it will all be erased and will not appear again. How can I draw so that it stays and doesn't disappear?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question