chartjs / Chart.js

Simple HTML5 Charts using the <canvas> tag
https://www.chartjs.org/
MIT License
64.49k stars 11.89k forks source link

Missing docs for multiple tooltip callback options #10458

Open mcandre opened 2 years ago

mcandre commented 2 years ago

Documentation Is:

Please Explain in Detail...

The docs only provide information for certain tooltip callbacks like label. The other tooltip callbacks do not provide documentation, not even signatures for the structure of the callbacks.

The problem is compounded by the fact that the interface has significantly changed over the years; Stack Overflow posts often provide incorrect advice.

Your Proposal for Changes

Provide the same level of documentation across all tooltip callbacks.

Example

https://www.chartjs.org/docs/latest/configuration/tooltip.html#tooltip-callbacks

LeeLenaleee commented 2 years ago

The table with callbacks already gives the paramater the callback gets and the return type.

I think that if you make a basic chart for every callback the page might become soo big that it will work in the opposite direction since it is a lot of the same. Since allmost all the callbacks are the same as the label callback, you can return a string to it. Only color and pointStyle are different so they are worked out so you can see the return type correctly.