Replies: 1 comment 1 reply
-
See #2309 which suggests https://observablehq.com/@observablehq/plot-grouped-tips |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there,
I am struggling with adapting tooltips to my needs in stacked charts. My charts basically show data from two channels. The tooltip by default would only show me the data for the single channel that I’m hovering. I would like to customize this, to show the data for both channels and the sum of both channels, in the tooltip. What is the best way to achieve that?
So far, I managed it a bit by duplicating my data, basically I transform my data first:
Then I can hide the “y” and instead show the custom data:
This works, but feels pretty convoluted - is there an easier way? And sadly it still shows the “channel” that I’m hovering and I cannot manage to hide that - how could I do that?
Now, I can live with the above. But when I try to apply the same trick on a sum-aggregated plot, e.g.:
then the tooltip would show me the raw data for an individual point, and not the summed one:
How would I handle that? I.e. how could I also apply something like y: "sum" for the y: "out" to my other data fields like out_ch1, out_ch2, and out_combined?
Again, it feels like my approach is backwards. The way it breaks down here makes me believe I’m not doing it the right way.
Cheers
Beta Was this translation helpful? Give feedback.
All reactions