]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Suport minUnit for time scale 3254/head
authorIan Ker-Seymer <i.kerseymer@gmail.com>
Fri, 2 Sep 2016 20:39:25 +0000 (16:39 -0400)
committerIan Ker-Seymer <i.kerseymer@gmail.com>
Tue, 6 Sep 2016 17:11:06 +0000 (13:11 -0400)
commit7af6e7f19223e16bc25d9e47850831c843a97144
treed8ce5f56b2fe7da543c8a1869a23da3dfc6a9838
parent6269e2c437a8beccc2516a1635491ab60371950f
Suport minUnit for time scale

When dealing with time-delineated datasets, often we have data for known
intervals of time. For example, we may have a dataset which represents number
of purchases per day:

```json
{
labels: ['2016-01-01', '2016-01-02', '2016-01-03']
datasets: [
{
data: [12, 87, 42]
}
],
'...': '...'
}
```

In this case, Chart.js will attempt to figure out the best interval to display
the data, and could pick `hours` as the unit. However, in this case, we would
prefer to just use the `days` interval since our data's granularity can not be
represented well with `hours`.

To remedy this, this commit adds the `minUnit` option which allows
users to (optionally) specify what the minimum unit they would like
to use.
docs/02-Scales.md
src/scales/scale.time.js
test/scale.time.tests.js