You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, only the (truncated) label and value is passed into the customHTML callback of the donut chart options. This makes it hard to find the original data point that the tooltip belongs to. Especially because a label might be truncated if it's too long, and thus may have become non-unique. Confusingly, the donut chart has a default truncation set on the tooltip so as developer you might not even be aware that the label passed to the customHTML callback can be non-unique.
In order to disable the truncation you need to set this on the donut chart options:
- updated handler for tooltip show event to extract the datum
from the event details and pass it as an argument to the customHTML
callback function if one was specific within the chart options
Closecarbon-design-system#1518
Signed-off-by: Steven Massola <steven.massola@ibm.com>
Contact Details
No response
What happened?
Currently, only the (truncated) label and value is passed into the
customHTML
callback of the donut chart options. This makes it hard to find the original data point that the tooltip belongs to. Especially because a label might be truncated if it's too long, and thus may have become non-unique. Confusingly, the donut chart has a default truncation set on the tooltip so as developer you might not even be aware that the label passed to thecustomHTML
callback can be non-unique.In order to disable the truncation you need to set this on the donut chart options:
It would be very helpful if this caveat was documented somewhere.
This is the information that's currently passed to
DonutChartOption
'scustomHTML
:(also the
value
becomes anumber
if truncation is turned off, that was also a bit unexpected)It would be better if the full data point was passed just like with the other charts:
because then you wouldn't need to worry about truncation.
See how in the sandbox screen the label printed to the console is truncated:
Version
@carbon/charts-react@0.57.0 but it also happens on the latest version
Data & options used
Relevant log output
No response
Codesandbox example
https://codesandbox.io/s/stupefied-fermi-0sj2nm?file=/src/index.js
The text was updated successfully, but these errors were encountered: