Skip to content

Commit c8f8e95

Browse files
committed
Docs + tests optimization
1 parent 7596f64 commit c8f8e95

File tree

9 files changed

+23
-24
lines changed

9 files changed

+23
-24
lines changed

docs/charts/bar.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ You can also specify the dataset as x/y coordinates when using the [time scale](
213213
data: [{x:'2016-12-25', y:20}, {x:'2016-12-26', y:10}]
214214
```
215215

216+
You can also specify the dataset for a bar chart as arrays of two numbers. This will force rendering of bars with gaps between them (floating-bars). First and second numbers in array will correspond the start and the end point of a bar respectively.
217+
```javascript
218+
data: [[5,6], [-3,-6]]
219+
```
220+
216221
## Stacked Bar Chart
217222

218223
Bar charts can be configured into stacked bar charts by changing the settings on the X and Y axes to enable stacking. Stacked bar charts can be used to show how one data series is made up of a number of smaller pieces.

test/fixtures/controller.bar/floatBar/float-bar-horizontal.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@
1919
"legend": false,
2020
"scales": {
2121
"xAxes": [{
22+
"display": false,
2223
"ticks": {
23-
"source": "labels",
24-
"display": false
24+
"min": -8,
25+
"max": 12
2526
}
2627
}],
2728
"yAxes": [{
28-
"ticks": {
29-
"display": false,
30-
"beginAtZero": true
31-
}
29+
"display": false
3230
}]
3331
}
3432
}
-3.38 KB
Loading

test/fixtures/controller.bar/floatBar/float-bar-stacked-horizontal.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@
1919
"legend": false,
2020
"scales": {
2121
"xAxes": [{
22-
"stacked": true,
23-
"ticks": {
24-
"source": "labels",
25-
"display": false
26-
}
22+
"display": false,
23+
"stacked": true
2724
}],
2825
"yAxes": [{
26+
"display": false,
2927
"stacked": true,
3028
"ticks": {
31-
"display": false,
32-
"beginAtZero": true
29+
"min": -8,
30+
"max": 12
3331
}
3432
}]
3533
}
-2.5 KB
Loading

test/fixtures/controller.bar/floatBar/float-bar-stacked.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
"legend": false,
2020
"scales": {
2121
"xAxes": [{
22+
"display": false,
2223
"stacked": true,
2324
"ticks": {
24-
"display": false
25+
"min": -8,
26+
"max": 12
2527
}
2628
}],
2729
"yAxes": [{
28-
"stacked": true,
29-
"ticks": {
30-
"display": false
31-
}
30+
"display": false,
31+
"stacked": true
3232
}]
3333
}
3434
}
-2.14 KB
Loading

test/fixtures/controller.bar/floatBar/float-bar.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@
1919
"legend": false,
2020
"scales": {
2121
"xAxes": [{
22+
"display": false,
2223
"ticks": {
23-
"source": "labels",
24-
"display": false
24+
"min": -8,
25+
"max": 12
2526
}
2627
}],
2728
"yAxes": [{
28-
"ticks": {
29-
"display": false,
30-
"beginAtZero": true
31-
}
29+
"display": false
3230
}]
3331
}
3432
}
-3.23 KB
Loading

0 commit comments

Comments
 (0)