Skip to content

Commit

Permalink
Docs + tests optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
gwyneblaidd committed Apr 23, 2019
1 parent 7596f64 commit c8f8e95
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 24 deletions.
5 changes: 5 additions & 0 deletions docs/charts/bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ You can also specify the dataset as x/y coordinates when using the [time scale](
data: [{x:'2016-12-25', y:20}, {x:'2016-12-26', y:10}]
```

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.
```javascript
data: [[5,6], [-3,-6]]
```

## Stacked Bar Chart

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.
Expand Down
10 changes: 4 additions & 6 deletions test/fixtures/controller.bar/floatBar/float-bar-horizontal.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@
"legend": false,
"scales": {
"xAxes": [{
"display": false,
"ticks": {
"source": "labels",
"display": false
"min": -8,
"max": 12
}
}],
"yAxes": [{
"ticks": {
"display": false,
"beginAtZero": true
}
"display": false
}]
}
}
Expand Down
Binary file modified test/fixtures/controller.bar/floatBar/float-bar-horizontal.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@
"legend": false,
"scales": {
"xAxes": [{
"stacked": true,
"ticks": {
"source": "labels",
"display": false
}
"display": false,
"stacked": true
}],
"yAxes": [{
"display": false,
"stacked": true,
"ticks": {
"display": false,
"beginAtZero": true
"min": -8,
"max": 12
}
}]
}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions test/fixtures/controller.bar/floatBar/float-bar-stacked.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"legend": false,
"scales": {
"xAxes": [{
"display": false,
"stacked": true,
"ticks": {
"display": false
"min": -8,
"max": 12
}
}],
"yAxes": [{
"stacked": true,
"ticks": {
"display": false
}
"display": false,
"stacked": true
}]
}
}
Expand Down
Binary file modified test/fixtures/controller.bar/floatBar/float-bar-stacked.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 4 additions & 6 deletions test/fixtures/controller.bar/floatBar/float-bar.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@
"legend": false,
"scales": {
"xAxes": [{
"display": false,
"ticks": {
"source": "labels",
"display": false
"min": -8,
"max": 12
}
}],
"yAxes": [{
"ticks": {
"display": false,
"beginAtZero": true
}
"display": false
}]
}
}
Expand Down
Binary file modified test/fixtures/controller.bar/floatBar/float-bar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c8f8e95

Please sign in to comment.