@@ -33,7 +33,7 @@ packageVersion('plotly')
33
33
```
34
34
35
35
```
36
- ## [1] '4.7.1.9000 '
36
+ ## [1] '4.8.0 '
37
37
```
38
38
39
39
### Basic Filled Area Plot
@@ -57,7 +57,7 @@ chart_link = api_create(p, filename="area-basic")
57
57
chart_link
58
58
```
59
59
60
- <iframe src =" https://plot.ly/~RPlotBot/3621 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
60
+ <iframe src =" https://plot.ly/~RPlotBot/5322 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
61
61
62
62
### Filled Area Plot with Multiple Traces
63
63
@@ -84,7 +84,7 @@ chart_link = api_create(p, filename="area-basic2")
84
84
chart_link
85
85
```
86
86
87
- <iframe src =" https://plot.ly/~RPlotBot/3613 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
87
+ <iframe src =" https://plot.ly/~RPlotBot/5324 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
88
88
89
89
### Selecting Hover Points
90
90
@@ -141,7 +141,7 @@ chart_link = api_create(p, filename="area-hoveron")
141
141
chart_link
142
142
```
143
143
144
- <iframe src =" https://plot.ly/~RPlotBot/5224 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
144
+ <iframe src =" https://plot.ly/~RPlotBot/5326 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
145
145
146
146
### Custom Colors
147
147
@@ -169,7 +169,7 @@ chart_link = api_create(p, filename="area-colors")
169
169
chart_link
170
170
```
171
171
172
- <iframe src =" https://plot.ly/~RPlotBot/3615 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
172
+ <iframe src =" https://plot.ly/~RPlotBot/5328 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
173
173
174
174
### Area Plot without Lines
175
175
@@ -198,7 +198,7 @@ chart_link = api_create(p, filename="area-nolines")
198
198
chart_link
199
199
```
200
200
201
- <iframe src =" https://plot.ly/~RPlotBot/3617 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
201
+ <iframe src =" https://plot.ly/~RPlotBot/5330 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
202
202
203
203
### Interior Filling for Area Chart
204
204
@@ -250,7 +250,7 @@ chart_link = api_create(p, filename="area-interior")
250
250
chart_link
251
251
```
252
252
253
- <iframe src =" https://plot.ly/~RPlotBot/3619 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
253
+ <iframe src =" https://plot.ly/~RPlotBot/5332 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
254
254
255
255
### Stacked Area Chart with Original Values
256
256
@@ -261,7 +261,7 @@ library(plotly)
261
261
data <- t(USPersonalExpenditure )
262
262
data <- data.frame (" year" = rownames(data ), data )
263
263
264
- p <- plot_ly(data , x = ~ year , y = ~ Food.and.Tobacco , name = ' Food and Tobacco' , type = ' scatter' , mode = ' none' , fill = ' tozeroy ' , fillcolor = ' #F5FF8D' ) %> %
264
+ p <- plot_ly(data , x = ~ year , y = ~ Food.and.Tobacco , name = ' Food and Tobacco' , type = ' scatter' , mode = ' none' , stackgroup = ' one ' , fillcolor = ' #F5FF8D' ) %> %
265
265
add_trace(y = ~ Household.Operation , name = ' Household Operation' , fillcolor = ' #50CB86' ) %> %
266
266
add_trace(y = ~ Medical.and.Health , name = ' Medical and Health' , fillcolor = ' #4C74C9' ) %> %
267
267
add_trace(y = ~ Personal.Care , name = ' Personal Care' , fillcolor = ' #700961' ) %> %
@@ -278,7 +278,7 @@ chart_link = api_create(p, filename="area-stackedoriginal")
278
278
chart_link
279
279
```
280
280
281
- <iframe src =" https://plot.ly/~RPlotBot/3623 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
281
+ <iframe src =" https://plot.ly/~RPlotBot/5334 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
282
282
283
283
### Stacked Area Chart with Cumulative Values
284
284
@@ -287,15 +287,9 @@ chart_link
287
287
library(plotly )
288
288
289
289
data <- t(USPersonalExpenditure )
290
- data2 <- data / rowSums(data )* 100
291
- data2 <- data.frame (" year" = rownames(data2 ), data2 )
292
-
293
- # Transforming into a cumulative table:
294
- for (i in c(6 : 3 )) {
295
- data2 [,i - 1 ] <- data2 [,i - 1 ] + data2 [,i ]
296
- }
290
+ data <- data.frame (" year" = rownames(data ), data )
297
291
298
- p <- plot_ly(data2 , x = ~ year , y = ~ Food.and.Tobacco , name = ' Food and Tobacco' , type = ' scatter' , mode = ' none' , fill = ' tozeroy ' , fillcolor = ' #F5FF8D' ) %> %
292
+ p <- plot_ly(data , x = ~ year , y = ~ Food.and.Tobacco , name = ' Food and Tobacco' , type = ' scatter' , mode = ' none' , stackgroup = ' one ' , groupnorm = ' percent ' , fillcolor = ' #F5FF8D' ) %> %
299
293
add_trace(y = ~ Household.Operation , name = ' Household Operation' , fillcolor = ' #50CB86' ) %> %
300
294
add_trace(y = ~ Medical.and.Health , name = ' Medical and Health' , fillcolor = ' #4C74C9' ) %> %
301
295
add_trace(y = ~ Personal.Care , name = ' Personal Care' , fillcolor = ' #700961' ) %> %
@@ -313,7 +307,7 @@ chart_link = api_create(p, filename="area-stackedcum")
313
307
chart_link
314
308
```
315
309
316
- <iframe src =" https://plot.ly/~RPlotBot/3625 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
310
+ <iframe src =" https://plot.ly/~RPlotBot/5336 .embed " width =" 800 " height =" 600 " id =" igraph " scrolling =" no " seamless =" seamless " frameBorder =" 0 " > </iframe >
317
311
318
312
#Reference
319
313
0 commit comments