carbon-design-system / carbon-charts

:bar_chart: :chart_with_upwards_trend:⠀Robust dataviz framework implemented using D3 & typescript
https://charts.carbondesignsystem.com
Apache License 2.0
912 stars 185 forks source link

[Bug]: tooltip.customHTML function data parameter #1426

Open boazdavid opened 2 years ago

boazdavid commented 2 years ago

Contact Details

boaz1234@gmail.com

What happened?

Im using a Boxplot and want to write a custom tooltip. in the options, I set tooltip.customHTML = (data, ....) => ..... The data that is passed has this structure: [{"label":"Class","value":"Testing_Locati...","class":"tooltip-1-1-1"},{"label":"Outlier","value":"3.888"}] Note that the value attribute in the first item is truncated and has an ellipsis, and the value of the second item is rounded. The original item is:{group: 'Testing_Locations', key: 'I need to be checked', value: 3.888350486755371} I expected the data parameter to carry the DATA as is. Now, it is difficult to find the data item that this point refers to.

Version

"@carbon/charts": "^0.54.12", "@carbon/charts-react": "^0.53.5",

Data & options used

No response

Relevant log output

[{"label":"Class","value":"Q2","class":"tooltip-1-1-1"},{"label":"Outlier","value":"Jan 1, 66456"}]

Codesandbox example

https://codesandbox.io/s/zfny6o?file=/src/index.js Hover over one of the outliers

andresfaj commented 1 year ago

Were you able to find any solution for this? @boazdavid

Hello @theiliad do you know anything about this?

I need to set another type of HTMLcontent for the outliers image

boazdavid commented 1 year ago

No, I did not find a solution