Help with multi-value functions #3959
philipdeboer
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The docs show a helpful example of a multi-line chart with tooltips attached to a rule (code copied below for easy reference, from
transform_pivot).
Is there a way to show a second set of values for each stock, eg the daily traded volume?
If there were many lines, say 50 instead of 5, then I would show several aggregate fields in the tooltip, such as the mean and min. (Incidentally, it would be great to have user-specified quantiles, say 90 or 99.) And then
transform_pivotis not needed, we can show themeanandminof both stock price and traded volume.An
nthaggregation function in the tooltip could help here (ifnis user specified), by allowing us to skip thetransform_pivotand get at the data directly.I also tried using
transform_calculateto compute a new string column based on numerical columns (something like f'{stock:.2f} ({volume/1000:.0f}k)' orjoin([format(datum.stock, ".2f"), format(datum.volume/1000, ".0f")])), but ran into blockers there too.In fact I couldn't even seem to get a calculated text string to show up as the value of the tooltip, even when the type is explicitly set to nominal and there was no attempt at aggregation.
Happy to sketch out what I've tried, if you think any of this should already work.
Beta Was this translation helpful? Give feedback.
All reactions