-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e_on on tile and secondary plot #638
Comments
Use df%>%
dplyr::summarise(n = n(), .by = tx_o2.factor) %>%
dplyr::mutate(
N = sum(n),
pct = round(n / N, 2),
lab_pct = str_c(round(pct * 100), "%"),
lab_n = str_c(n, " / ", N)
) %>%
e_charts(tx_o2.factor) %>%
e_pie(pct, radius = c("40%", "70%"), name = "pie") %>% # add name
e_labels(formatter = htmlwidgets::JS("
function(params) {
return params.name + ': ' + 100 * params.value + '%'
}")) %>%
e_tooltip(trigger = "item", formatter = htmlwidgets::JS("
function(params) {
return '<strong>' + params.name + '</strong><br /> ' + 100 * params.value + '%'
}"), backgroundColor = "rgba(255,255,255,0.7)") %>%
e_on(list(seriesName = "pie"), # use name
"function(params) {
console.log('Clicked on: ', params);
}") |
thank you but nothing happen when I click. sorry ...
|
I removed the |
trying now |
really sorry. Sample data
|
just tried the code below but nothing happen
I would like to see a secondary plot to appear based on the segment I click on.
and if I click on no,
the final objective is to have it to run in a shiny app... |
Did you check that |
I thought params.name was coming from e_charts(tx_o2.factor)
|
I confirm params.name exists
so params.name corresponds to yes or no. |
I cannot run the code you shared. |
sorry. would you mind trying
or outside of rshiny
thank you for your patience and support. really appreciated. |
Hello
I am struggling with e_on. My goal is to have a secondary graph to appear on the side of the primary graph when clicking on the tile corresponding to the 'yes'
for example this dataframe
I can generate the main pie chart
and my secondary graph could be for example
but only appears when I click on the yes tile of the pie chart.... ?
and ALL in one (not working at all)
does that make sense? any suggestion?
The text was updated successfully, but these errors were encountered: