You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To show an arbitrary text in your chart you can use [texttemplate](https://plot.ly/r/reference/#pie-texttemplate), which is a template string used for rendering the information, and will override [textinfo](https://plot.ly/r/reference/#treemap-textinfo).
371
+
This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_forma), and `date` in [d3-time-fomrat's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format).
372
+
`texttemplate` customizes the text that appears on your plot vs. [hovertemplate](https://plot.ly/r/reference/#pie-hovertemplate) that customizes the tooltip text.
373
+
374
+
```{r}
375
+
library(plotly)
376
+
377
+
fig <- plot_ly(
378
+
type='pie',
379
+
values=c(40000000, 20000000, 30000000, 10000000),
380
+
labels=c("Wages", "Operating expenses", "Cost of sales", "Insurance"),
The following example shows how to show date by setting [axis.type](https://plot.ly/r/reference/#layout-yaxis-type) in [funnel charts](https://plot.ly/r/funnel-charts/).
409
+
As you can see [textinfo](https://plot.ly/r/reference/#funnel-textinfo) and [texttemplate](https://plot.ly/r/reference/#funnel-texttemplate) have the same functionality when you want to determine 'just' the trace information on the graph.
410
+
411
+
```{r}
412
+
fig <- plot_ly()
413
+
414
+
fig <- fig %>% add_trace(
415
+
type='funnel',
416
+
name = 'Montreal',
417
+
orientation = "h",
418
+
y = c("2018-01-01", "2018-07-01", "2019-01-01", "2020-01-01"),
419
+
x = c(100, 60, 40, 20),
420
+
textposition = "inside",
421
+
texttemplate = "%{y| %a. %_d %b %Y}")
422
+
423
+
fig <- fig %>% add_trace(
424
+
type='funnel',
425
+
name = 'Vancouver',
426
+
orientation = "h",
427
+
y = c("2018-01-01", "2018-07-01", "2019-01-01", "2020-01-01"),
0 commit comments