datasketch / hgchmagic

https://datasketch.github.io/hgchmagic/
Other
3 stars 6 forks source link

Enable tooltips and labels to show different format #71

Closed lenafm closed 3 years ago

lenafm commented 4 years ago

E.g. enable for tooltips to display total numbers while labels show percentages (or vice versa).

lenafm commented 3 years ago

For example, if the data has more columns apart from the data used to create the plot, then it should be possible to use any of these extra columns in the tooltips (as in the below code). At the moment this produces an error.

library(hgchmagic)
x <- sample_data("Cat-Num") %>% mutate(extra_label = "blah")

hgch_bar_CatNum(x, 
                tooltip = "{extra_label}")
jpmarindiaz commented 3 years ago

We need to agree on how to handle the "extra" columns in all cases, the same applies to columns when you want to provide the specific colors of a category