Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Missing docs for multiple tooltip callback options

Open mcandre opened this issue 3 years ago • 1 comments

Documentation Is:

  • [X] Missing or needed?
  • [ ] Confusing
  • [ ] Not sure?

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

mcandre avatar Jun 29 '22 17:06 mcandre

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.

LeeLenaleee avatar Jun 30 '22 10:06 LeeLenaleee