carbon-charts
carbon-charts copied to clipboard
Allow translations of hard-coded tooltip strings
I am submitting a...
- [ ] Feature request
- [x] Design defect
- [ ] Source code defect
- [ ] Demo/documentation defect
- [ ] Other
charts version:
36.2
Issue description
If we have a single line line chart (or if we mouse over a single point of a linechart), we're seeing a tooltip with a separate 'Group' field where the color of the line is placed.
Because our product is translated, the word Group is in English. Ideally we'd just have the actual line value with the color indicator on it:
The way the multiline tooltip looks
(However, I also need a way to exclude the 'Total' from the multiline lineChart tooltip shown above, since again we're in a translated product.
Steps to produce the issue
Current behavior
Expected behavior
Screenshot or recording
https://github.ibm.com/wiotp/monitoring-dashboard/issues/1380
So a couple of points here:
- seems like you've overriden the
y-axis
label in here to the left of8.2
that'll for sure make for a broken experience for that item. I suggest keeping it in as it uses your y-axis title (which in a translated chart should also be in the translated language) or will simply have the label
y-axis
in there which we can expose to translations.
- for total
, yes we can introduce a flag that'll let you change the copy on that item
oh, @theiliad is it pulling the point label from the axes.title option?
{"bottom":{"title":"","mapsTo":"date","scaleType":"time","ticks":{"max":4},"includeZero":true},"left":{"title":" ","mapsTo":"value","ticks":{},"stacked":false,"includeZero":true,"scaleType":"linear"}}
because for us, each line has it's own label as we're graphing multiple sensors on the same y-axis. we pass the 'label' of each line in the Group option for a data row, but would expect it to be used next to the value just like it is for the 'multiple' version of the tooltip above. here's an example data item that's being graphed {"date":"2020-09-29T10:54:49.000Z","value":76,"group":"Temperature"}
. We would expect the tooltip to show Temperature: 76
in a row with a color of purple next to it the way that the multi-tooltip shows
oh, @theiliad is it pulling the point label from the axes.title option?
{"bottom":{"title":"","mapsTo":"date","scaleType":"time","ticks":{"max":4},"includeZero":true},"left":{"title":" ","mapsTo":"value","ticks":{},"stacked":false,"includeZero":true,"scaleType":"linear"}}
because for us, each line has it's own label as we're graphing multiple sensors on the same y-axis. we pass the 'label' of each line in the Group option for a data row, but would expect it to be used next to the value just like it is for the 'multiple' version of the tooltip above. here's an example data item that's being graphed
{"date":"2020-09-29T10:54:49.000Z","value":76,"group":"Temperature"}
. We would expect the tooltip to showTemperature: 76
in a row with a color of purple next to it the way that the multi-tooltip shows
I think I need a bit more clarity on your use-case. From what I'm understanding you'd like each dataGroup to take up a row in the tooltip, which is currently the case
I might actually be misunderstanding your demands
it works great if we mouse over the grid line, but if we mouse over just in the individual point, the tooltip switches to a different single format where it removes the Color and Label indicator for the point, and instead shows 'Group' on the bottom of the tooltip
Yes, this'll happen when singling out a datapoint
Are you asking to see the mutiline
tooltip in that case as well, or are you asking for a flag that'll let you customize the term Group
in the singular tooltip?
I'd rather just have the multiline tooltip format in that case honestly with just the one value row. and I'm okay if the Total/Group is hidden in that case where we're just looking at the single point
@scottdickerson - does this issue (https://github.com/carbon-design-system/carbon-charts/issues/1635) address what you're running into? If so, perhaps consider closing this one so we can consolidate. Feel free to update the other issue if you'd like to see anything changed.