Skip to content

Commit d376d5a

Browse files
committed
Update README
1 parent 04b220e commit d376d5a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,26 +1300,50 @@ A new **y** channel is eventually returned, which lazily computes the middle val
13001300

13011301
#### Plot.stackY(*options*)
13021302

1303+
```js
1304+
Plot.stackY({x: "year", y: "revenue", z: "format", fill: "group"})
1305+
```
1306+
13031307
Creates new channels **y1** and **y2**, obtained by stacking the original **y** channel for data points that share a common **x** (and possibly **z**) value. A new **y** channel is also returned, which lazily computes the middle value of **y1** and **y2**. The input **y** channel defaults to a constant 1, resulting in a count of the data points.
13041308

13051309
#### Plot.stackY1(*options*)
13061310

1311+
```js
1312+
Plot.stackY1({x: "year", y: "revenue", z: "format", fill: "group"})
1313+
```
1314+
13071315
Equivalent to [Plot.stackY](#plotstackyoptions), except that the **y1** channel is returned as the **y** channel. This can be used, for example, to draw a line at the bottom of each stacked area.
13081316

13091317
#### Plot.stackY2(*options*)
13101318

1319+
```js
1320+
Plot.stackY2({x: "year", y: "revenue", z: "format", fill: "group"})
1321+
```
1322+
13111323
Equivalent to [Plot.stackY](#plotstackyoptions), except that the **y2** channel is returned as the **y** channel. This can be used, for example, to draw a line at the top of each stacked area.
13121324

13131325
#### Plot.stackX(*options*)
13141326

1327+
```js
1328+
Plot.stackX({y: "year", x: "revenue", z: "format", fill: "group"})
1329+
```
1330+
13151331
See Plot.stackY, but with *x* as the input value channel, *y* as the stack index, *x1*, *x2* and *x* as the output channels.
13161332

13171333
#### Plot.stackX1(*options*)
13181334

1335+
```js
1336+
Plot.stackX1({y: "year", x: "revenue", z: "format", fill: "group"})
1337+
```
1338+
13191339
Equivalent to [Plot.stackX](#plotstackxoptions), except that the **x1** channel is returned as the **x** channel. This can be used, for example, to draw a line at the left edge of each stacked area.
13201340

13211341
#### Plot.stackX2(*options*)
13221342

1343+
```js
1344+
Plot.stackX2({y: "year", x: "revenue", z: "format", fill: "group"})
1345+
```
1346+
13231347
Equivalent to [Plot.stackX](#plotstackxoptions), except that the **x2** channel is returned as the **x** channel. This can be used, for example, to draw a line at the right edge of each stacked area.
13241348

13251349
## Curves

0 commit comments

Comments
 (0)