v1 error chart
- Dominant language
- Handlebars
- Stars
- 265
- Forks
- 236
- PR merge metrics
- No merged PRs in 30d
Description
@rgdonohue asked in slack about how you can adapt the [v0 error bars example](http://cedar-v0.surge.sh/examples/errorbars.html) to work in v1. Here's a working example:
Go to http://cedar-v1.surge.sh/ and enter the following in the JSON editor:
```json
{
"type": "bar",
"datasets": [
{
"data": {
"features": [
{"attributes": {"state": "CA", "pop": 5000, "error": 2000}},
{"attributes": {"state": "AZ", "pop": 2000, "error": 1400}},
{"attributes": {"state": "NY", "pop": 8000, "error": 1000}}
]
}
}
],
"series": [
{
"category": {"field": "state", "label": "State"},
"value": {"field": "pop", "label": "Population"}
}
],
"overrides": {
"valueAxes": [{
"id": "v1"
}],
"graphs": [{
"balloonText": "value:[[value]]
error:[[error]]",
"bullet": "yError",
"bulletSize": 10,
"errorField": "error",
"bulletAxis": "v1"
}]
}
}
```
You will get something like this:

The key is the `overrides` section which allows you to set the relevant [AmCharts properties](https://docs.amcharts.com/3/javascriptcharts/AmChart) to match their [error char example](https://www.amcharts.com/demos/error-chart/).
@benstoltz
If we want to make this easier we should add default `id`s to the spec axes.
@ajturner @ghudgins
Do we want to open an issue for the Cedar JSON to support errors, perhaps by allowing users to specify an `errorField` on series, so that consumers don't have to use `overrides`?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.