Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
6ecad0b
Attempt to fix the failing deploy step
simonbrunel May 25, 2017
ea725c0
Fix code climate badge and link (#4277)
benmccann May 25, 2017
04ab523
Upgrade dependencies (#4272)
benmccann May 25, 2017
1cbba83
Refactor time scale methods into a common location
benmccann May 5, 2017
7579198
Upgrade dependencies
benmccann May 25, 2017
2258199
Add hard coded integer constants for *_SAFE_INTEGER which are not ava…
OlduwanSteve May 27, 2017
394382b
Add tooltip textLabelColor callback (#4199)
apoorvasrinivasan May 28, 2017
dab0a7f
Fix onHover event not being triggered (#4297)
May 28, 2017
f7f177f
Implemented aligment by senior unit in time axis. (#4267)
hurskiy-andriy May 29, 2017
fa6be2f
Fix inconsistent aspect ratio
jtblin Mar 26, 2017
0d1f68c
Fix incorrect unitStepSize option. It should be stepSize (#4320)
etimberg Jun 4, 2017
8eee124
Added 'devicePixelRatio' option to override the window's DPR setting …
Jun 4, 2017
fd49ac9
Provide a blank default global layout option (#4319)
etimberg Jun 4, 2017
a930830
Fix vertical alignment of legend labels (#4318)
etimberg Jun 4, 2017
7ee8da9
Fix broken link on animations page #4324
raquelguimaraes Jun 4, 2017
2a9a57e
Use the latest 6.x LTS release for Travis builds (#4346)
benmccann Jun 7, 2017
9b8c24c
Make sure that the border width of the tooltip color box is always co…
etimberg Jun 6, 2017
7423c48
Fix round option for time scales
etimberg Jun 8, 2017
9e6a611
Fix Tiny Typo in Labelling.md
Jun 8, 2017
5e58114
Fix filling between datasets of different lengths
simonbrunel Jun 10, 2017
009ae4d
Support hover animation duration during updates (#4300)
Jun 11, 2017
3a2884f
Fixed tiny typo in title.md
moortaube Jun 12, 2017
2d7c1f0
Time axis tick formatting with major and minor units (#4268)
hurskiy-andriy Jun 15, 2017
28da154
HighCharts is not open source (#4383)
brother Jun 16, 2017
7a02d93
Add note regarding non-existant fonts
etimberg Jun 19, 2017
de0ea5c
Multiple lines of text in the chart title
etimberg Jun 15, 2017
46c0455
Wording error
uok Jun 22, 2017
b548d1a
Add description on new dataset update and draw plugin hooks
nagix Jun 22, 2017
bef44cc
Ensure that chart dimensions are always >= 0
Peter-Van-Drunen Jun 23, 2017
9619110
Fix arguments in plugin interface description
nagix Jun 22, 2017
18707cf
Line height setting for scale titles. The text is centered within the…
etimberg Jun 19, 2017
2a7df85
Add aria-hidden=true attribute to hidden iframe for resizing (#4400)
kabhati Jun 23, 2017
e543f87
Update Display Format table
nagix Jun 23, 2017
6c82c93
Fix error when legend label options are not defined (#4402)
etimberg Jun 24, 2017
5196e05
Cleanup and reorganize core and canvas helpers
simonbrunel Jun 24, 2017
5d95280
Change `valueAtIndexOrDefault` behavior (#4423)
simonbrunel Jun 25, 2017
8834bab
Ensure deprecated unitStepSize property of time scale is respected (#…
etimberg Jun 25, 2017
7fa6052
Update scatter chart default config to hide lines
etimberg Jun 15, 2017
548edc6
Fix non-passive event listener warning in Chrome
simonbrunel Jun 25, 2017
ccb2898
When all datasets are hidden, the linear scale defaults to a range of…
etimberg Jun 25, 2017
7f15beb
ticks.padding option applies to both vertical and horizontal axes
etimberg Jun 22, 2017
0eedec3
replace self closing script tag with open and closing tags
justinledford Jun 29, 2017
ecca337
Increase ESLint complexity and add config for tests (#4421)
simonbrunel Jul 1, 2017
e5a431e
Remove `.js` extensions when requiring a file (#4427)
let-aurn Jul 1, 2017
6f31713
Clamp radius when drawing rounded rectangle (#4448)
simonbrunel Jul 1, 2017
225bfd3
Rewrite the clone and merge helpers (#4422)
simonbrunel Jul 1, 2017
cc9e88a
Support an array for line chart pointBorderWidth
etimberg Jul 4, 2017
7d60857
Use proper reverse option in radial linear scale
etimberg Jul 3, 2017
9ec78ce
Add a note on how to use getElementAtEvent in a click handler
etimberg Jul 3, 2017
6e54bc5
Clip chart area before filling
nagix Jul 2, 2017
e8ebb46
Update link to documentation for previous versions
alex-paterson Jul 5, 2017
56050dc
Move easing effects in separate file + unit tests
simonbrunel Jul 8, 2017
463a8dd
Simplify formulas based on code review
simonbrunel Jul 8, 2017
f16d8a3
Fix links in documentations (#4477)
adrianliaw Jul 9, 2017
b03ab1c
Fix labelOffset not working for vertical axes (#4249)
suheb Jul 15, 2017
717e8d9
Make `Chart.helpers` importable (#4479)
simonbrunel Jul 15, 2017
8e643db
Fix copy paste error in new docs with respect to settings for line an…
etimberg Jul 15, 2017
1833614
Make `Chart.platform` importable (#4509)
simonbrunel Jul 16, 2017
889ecd5
Make `Chart.defaults/Ticks/Interaction` importable (#4512)
simonbrunel Jul 16, 2017
a0fc1c9
Add link to Java integration (#4527)
mdewilde Jul 18, 2017
3bb31ca
Allow category labels definition at scale level (#4506)
andig Jul 19, 2017
5ad1b4a
New time scale `ticks.mode/.source` options (#4507)
simonbrunel Jul 19, 2017
090196c
Add support for line height CSS values (#4531)
simonbrunel Jul 20, 2017
94099c1
Remove duplicate npm install (#4542)
benmccann Jul 21, 2017
586b8c1
Make `Chart.Element/elements.*` importable (#4540)
simonbrunel Jul 21, 2017
7b63888
Refactor padding parsing under helpers.options (#4544)
simonbrunel Jul 21, 2017
48d76b2
Allow specifying the time axis via t attribute (#4533)
benmccann Jul 22, 2017
f6b6956
Fix ESLint errors (#4485)
benmccann Jul 22, 2017
4c763bf
Enforce spaces around infix/unary words operators (#4547)
simonbrunel Jul 22, 2017
e7445a5
Honour time scale min/max settings (#4522)
andig Jul 22, 2017
48d6fac
Move and rewrite time helpers (#4549)
simonbrunel Jul 23, 2017
d07fb28
Add a note about breaking changes (#4555)
benmccann Jul 24, 2017
3aa7a20
New time scale `ticks.bounds` option (#4556)
simonbrunel Jul 25, 2017
c6bda02
Rewrite unit test waitForResize helper (#4566)
simonbrunel Jul 26, 2017
43baf2f
Instructions to access resources built from master
andig Jul 25, 2017
2cc242d
New time scale `ticks.source: 'data'` option (#4568)
simonbrunel Jul 27, 2017
326991c
index-y interaction mode + convert horizontal bar defaults to new mod…
etimberg Jul 28, 2017
56fdd7e
Allow specifying bar chart via {x, y} data points (#4565)
benmccann Jul 29, 2017
53b7a63
Change `scale.ticks` back to an array of strings (#4573)
simonbrunel Jul 29, 2017
97e2373
Change `ticks.mode` to `scale.distribution` (#4582)
simonbrunel Jul 30, 2017
f90ee8c
Add support for detached canvas element (#4591)
simonbrunel Aug 1, 2017
2c52209
Replace the IFRAME resizer by DIVs (#4596)
simonbrunel Aug 2, 2017
15934e4
Change `scale.ticks.bounds` to `scale.bounds` (#4595)
simonbrunel Aug 2, 2017
2922dc9
Allow updating dataset types (#4586)
benmccann Aug 2, 2017
51603cc
Make Chart.Ticks private and remove Chart.Ticks.generators.time (#4602)
benmccann Aug 2, 2017
9ef5cc7
Enforce variable declaration coding style (#4610)
simonbrunel Aug 3, 2017
8dca88c
Fix tests on OSX with retina screen
andig Aug 5, 2017
1eeffa3
Refactor autoskip functionality into a separate method (#4614)
benmccann Aug 7, 2017
4697226
Document new time options (#4592)
benmccann Aug 8, 2017
3e2b405
Ticks callback is now called with `this` as scope (#4632)
andig Aug 13, 2017
7e6b462
Update codeclimate.yml (#4654)
panzarino Aug 14, 2017
7dc71d0
Make `offsetGridLines` consistent and add new `offset` scale option (…
nagix Aug 14, 2017
b9afeaf
remove redundant tooltip initialize (#4655)
xg-wang Aug 14, 2017
0e5ce3f
Fix autoskipped ticks messing up category axis (#4649)
andig Aug 19, 2017
5a3de51
When a radial scale is rotated using the startAngle option, the tick …
etimberg Aug 21, 2017
46c3b24
Make bar tests independent from scales (#4686)
andig Aug 23, 2017
872dfec
Introduce scriptable options (bubble chart) (#4671)
simonbrunel Aug 24, 2017
e758798
Fix scriptable options documentation snippet
simonbrunel Aug 24, 2017
530c613
Improve bar test stability (#4694)
andig Aug 24, 2017
31049eb
Add chartjs-plugin-datalabels plugin link (#4701)
simonbrunel Aug 25, 2017
488cbbc
Fix flipped stepped line in filler plugin (#4697)
nagix Aug 25, 2017
5a014dc
Fix wild special zero grid line when undefined (#4700)
simonbrunel Aug 26, 2017
5d57de4
Fix bar chart with {x, y} data points (#4673)
nagix Aug 26, 2017
459c81d
Remove trailing `.js` in plugin names (docs)
simonbrunel Aug 26, 2017
2f950e2
Improve controller tests stability (#4698)
andig Aug 27, 2017
e3b70e0
Bump version to 2.7.0
simonbrunel Aug 28, 2017
c7464eb
Add platform basic implementation (fallback) (#4708)
simonbrunel Sep 2, 2017
427aa99
Make major ticks optional and off by default (#4723)
benmccann Sep 8, 2017
b2beb6f
Update chartjs-color dependency (#4733)
simonbrunel Sep 9, 2017
fb4357e
Add a financial time series sample (#4554)
benmccann Sep 10, 2017
543c31d
Add Google Analytics to samples and update badges (#4734)
simonbrunel Sep 10, 2017
ea703a5
Implement scale label padding (#4646)
andig Sep 10, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ engines:
config:
languages:
- javascript
exclude_paths:
- "samples/samples.js"
eslint:
enabled: true
channel: "eslint-3"
Expand All @@ -15,7 +13,13 @@ ratings:
paths:
- "src/**/*.js"
exclude_paths:
- dist/**/*
- node_modules/**/*
- test/**/*
- coverage/**/*
- '.github/'
- 'dist/'
- 'test/'
- 'docs/'
- 'samples/'
- 'scripts/'
- '**.md'
- '**.json'
- 'gulpfile.js'
- 'karma.conf.js'
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[gulpfile.js]
indent_style = space
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2
8 changes: 4 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ rules:
accessor-pairs: 2
array-callback-return: 0
block-scoped-var: 0
complexity: [2, 6]
complexity: [2, 10]
consistent-return: 0
curly: [2, all]
default-case: 2
Expand Down Expand Up @@ -183,7 +183,7 @@ rules:
object-curly-spacing: [2, never]
object-property-newline: 0
one-var-declaration-per-line: 2
one-var: 0
one-var: [2, {initialized: never}]
operator-assignment: 0
operator-linebreak: 0
padded-blocks: 0
Expand All @@ -197,8 +197,8 @@ rules:
space-before-blocks: [2, always]
space-before-function-paren: [2, never]
space-in-parens: [2, never]
space-infix-ops: 0
space-unary-ops: 0
space-infix-ops: 2
space-unary-ops: [2, {words: true, nonwords: false}]
spaced-comment: [2, always]
unicode-bom: 0
wrap-regex: 2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/dist
/docs/index.md
/gh-pages
/jsdoc
/node_modules
.DS_Store
.idea
Expand Down
20 changes: 6 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
language: node_js
node_js:
- "5.10"
- "6"

before_install:
- "export CHROME_BIN=/usr/bin/google-chrome"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"

before_script:
- npm install

script:
- gulp build
- gulp test --coverage
Expand All @@ -25,29 +22,24 @@ sudo: required
dist: trusty

addons:
chrome: stable
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable


# IMPORTANT: scripts require GITHUB_AUTH_TOKEN and GITHUB_AUTH_EMAIL environment variables
# IMPORTANT: scripts has to be set executables in the Git repository (error 127)
# https://github.com/travis-ci/travis-ci/issues/5538#issuecomment-225025939

deploy:
- provider: script
script: ./scripts/release.sh
script: ./scripts/deploy.sh
skip_cleanup: true
on:
branch: release
all_branches: true
- provider: script
script: ./scripts/deploy.sh
script: ./scripts/release.sh
skip_cleanup: true
on:
all_branches: true
branch: release
- provider: releases
api_key: $GITHUB_AUTH_TOKEN
file:
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Chart.js

[![Build Status](https://travis-ci.org/chartjs/Chart.js.svg?branch=master)](https://travis-ci.org/chartjs/Chart.js) [![Code Climate](https://codeclimate.com/github/nnnick/Chart.js/badges/gpa.svg)](https://codeclimate.com/github/nnnick/Chart.js) [![Coverage Status](https://coveralls.io/repos/github/chartjs/Chart.js/badge.svg?branch=master)](https://coveralls.io/github/chartjs/Chart.js?branch=master)

[![Chart.js on Slack](https://img.shields.io/badge/slack-Chart.js-blue.svg)](https://chart-js-automation.herokuapp.com/)
[![travis](https://img.shields.io/travis/chartjs/Chart.js.svg?style=flat-square&maxAge=60)](https://travis-ci.org/chartjs/Chart.js) [![codeclimate](https://img.shields.io/codeclimate/github/chartjs/Chart.js.svg?style=flat-square&maxAge=600)](https://codeclimate.com/github/chartjs/Chart.js) [![coveralls](https://img.shields.io/coveralls/chartjs/Chart.js.svg?style=flat-square&maxAge=600)](https://coveralls.io/github/chartjs/Chart.js?branch=master) [![slack](https://img.shields.io/badge/slack-Chart.js-blue.svg?style=flat-square&maxAge=3600)](https://chart-js-automation.herokuapp.com/)

*Simple HTML5 Charts using the canvas element* [chartjs.org](http://www.chartjs.org)

Expand All @@ -29,7 +27,7 @@ The `Chart.bundle.js` and `Chart.bundle.min.js` builds include Moment.js in a si

## Documentation

You can find documentation at [www.chartjs.org/docs](http://www.chartjs.org/docs). The markdown files that build the site are available under `/docs`. Previous version documentation is available at [www.chartjs.org/docs/#notes-previous-versions](http://www.chartjs.org/docs/#notes-previous-versions).
You can find documentation at [www.chartjs.org/docs](http://www.chartjs.org/docs). The markdown files that build the site are available under `/docs`. Previous version documentation is available at [www.chartjs.org/docs/latest/developers/#previous-versions](http://www.chartjs.org/docs/latest/developers/#previous-versions).

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Chart.js

[![Chart.js on Slack](https://img.shields.io/badge/slack-Chart.js-blue.svg)](https://chart-js-automation.herokuapp.com/)
[![slack](https://img.shields.io/badge/slack-Chart.js-blue.svg?style=flat-square&maxAge=600)](https://chart-js-automation.herokuapp.com/)

## Installation

Expand Down
3 changes: 2 additions & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* [Interactions](general/interactions/README.md)
* [Events](general/interactions/events.md)
* [Modes](general/interactions/modes.md)
* [Options](general/options.md)
* [Colors](general/colors.md)
* [Fonts](general/fonts.md)
* [Configuration](configuration/README.md)
Expand All @@ -34,7 +35,7 @@
* [Category](axes/cartesian/category.md)
* [Linear](axes/cartesian/linear.md)
* [Logarithmic](axes/cartesian/logarithmic.md)
* [Time](axes/cartesian/time.md)
* [Time](axes/cartesian/time.md)
* [Radial](axes/radial/README.md)
* [Linear](axes/radial/linear.md)
* [Labelling](axes/labelling.md)
Expand Down
5 changes: 3 additions & 2 deletions docs/axes/cartesian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All of the included cartesian axes support a number of common options.
| -----| ---- | --------| -----------
| `type` | `String` | | Type of scale being employed. Custom scales can be created and registered with a string key. This allows changing the type of an axis for a chart.
| `position` | `String` | | Position of the axis in the chart. Possible values are: `'top'`, `'left'`, `'bottom'`, `'right'`
| `offset` | `Boolean` | `false` | If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to `true` in the bar chart by default.
| `id` | `String` | | The ID is used to link datasets and scale axes together. [more...](#axis-id)
| `gridLines` | `Object` | | Grid line configuration. [more...](../styling.md#grid-line-configuration)
| `scaleLabel` | `Object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
Expand All @@ -31,7 +32,7 @@ The following options are common to all cartesian axes but do not apply to other
| `maxRotation` | `Number` | `90` | Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. *Note: Only applicable to horizontal scales.*
| `minRotation` | `Number` | `0` | Minimum rotation for tick labels. *Note: Only applicable to horizontal scales.*
| `mirror` | `Boolean` | `false` | Flips tick labels around axis, displaying the labels inside the chart instead of outside. *Note: Only applicable to vertical scales.*
| `padding` | `Number` | `10` | Padding between the tick label and the axis. *Note: Only applicable to horizontal scales.*
| `padding` | `Number` | `10` | Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction.

## Axis ID
The properties `dataset.xAxisID` or `dataset.yAxisID` have to match the scale properties `scales.xAxes.id` or `scales.yAxes.id`. This is especially needed if multi-axes charts are used.
Expand Down Expand Up @@ -101,4 +102,4 @@ var myChart = new Chart(ctx, {
}
}
});
```
```
35 changes: 34 additions & 1 deletion docs/axes/cartesian/category.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
# Category Cartesian Axis

The category scale will be familiar to those who have used v1.0. Labels are drawn from one of the label arrays included in the chart data. If only `data.labels` is defined, this will be used. If `data.xLabels` is defined and the axis is horizontal, this will be used. Similarly, if `data.yLabels` is defined and the axis is vertical, this property will be used. Using both `xLabels` and `yLabels` together can create a chart that uses strings for both the X and Y axes.
If global configuration is used, labels are drawn from one of the label arrays included in the chart data. If only `data.labels` is defined, this will be used. If `data.xLabels` is defined and the axis is horizontal, this will be used. Similarly, if `data.yLabels` is defined and the axis is vertical, this property will be used. Using both `xLabels` and `yLabels` together can create a chart that uses strings for both the X and Y axes.

Specifying any of the settings above defines the x axis as `type: category` if not defined otherwise. For more fine-grained control of category labels it is also possible to add `labels` as part of the category axis definition. Doing so does not apply the global defaults.

## Category Axis Definition

Globally:

```javascript
let chart = new Chart(ctx, {
type: ...
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June'],
datasets: ...
},
});
```
As part of axis definition:

```javascript
let chart = new Chart(ctx, {
type: ...
data: ...
options: {
scales: {
xAxes: [{
type: 'category',
labels: ['January', 'February', 'March', 'April', 'May', 'June'],
}]
}
}
});
```

## Tick Configuration Options

The category scale provides the following options for configuring tick marks. They are nested in the `ticks` sub object. These options extend the [common tick configuration](README.md#tick-configuration).

| Name | Type | Default | Description
| -----| ---- | --------| -----------
| labels | Array[String] | - | An array of labels to display.
| `min` | `String` | | The minimum item to display. [more...](#min-max-configuration)
| `max` | `String` | | The maximum item to display. [more...](#min-max-configuration)

Expand Down
117 changes: 86 additions & 31 deletions docs/axes/cartesian/time.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,46 @@

The time scale is used to display times and dates. When building its ticks, it will automatically calculate the most comfortable unit base on the size of the scale.

## Configuration Options
## Data Sets

The following options are provided by the time scale. They are all located in the `time` sub options. These options extend the [common tick configuration](README.md#tick-configuration).
### Input Data

The x-axis data points may additionally be specified via the `t` attribute when using the time scale.

data: [{
x: new Date(),
y: 1
}, {
t: new Date(),
y: 10
}]

| Name | Type | Default | Description
| -----| ---- | --------| -----------
| `displayFormats` | `Object` | | Sets how different time units are displayed. [more...](#display-formats)
| `isoWeekday` | `Boolean` | `false` | If true and the unit is set to 'week', iso weekdays will be used.
| `max` | [Time](#date-formats) | | If defined, this will override the data maximum
| `min` | [Time](#date-formats) | | If defined, this will override the data minimum
| `parser` | `String` or `Function` | | Custom parser for dates. [more...](#parser)
| `round` | `String` | `false` | If defined, dates will be rounded to the start of this unit. See [Time Units](#scales-time-units) below for the allowed units.
| `tooltipFormat` | `String` | | The moment js format string to use for the tooltip.
| `unit` | `String` | `false` | If defined, will force the unit to be a certain type. See [Time Units](#scales-time-units) section below for details.
| `unitStepSize` | `Number` | `1` | The number of units between grid lines.
| `minUnit` | `String` | `millisecond` | The minimum display format to be used for a time unit.

## Date Formats

### Date Formats

When providing data for the time scale, Chart.js supports all of the formats that Moment.js accepts. See [Moment.js docs](http://momentjs.com/docs/#/parsing/) for details.

## Time Units
## Configuration Options

The following options are provided by the time scale. You may also set options provided by the [common tick configuration](README.md#tick-configuration).

| Name | Type | Default | Description
| -----| ---- | --------| -----------
| `distribution` | `String` | `linear` | How data is plotted. [more...](#scale-distribution)
| `bounds` | `String` | `data` | Determines the scale bounds. [more...](#scale-bounds)
| `ticks.source` | `String` | `auto` | How ticks are generated. [more...](#ticks-source)
| `time.displayFormats` | `Object` | | Sets how different time units are displayed. [more...](#display-formats)
| `time.isoWeekday` | `Boolean` | `false` | If true and the unit is set to 'week', then the first day of the week will be Monday. Otherwise, it will be Sunday.
| `time.max` | [Time](#date-formats) | | If defined, this will override the data maximum
| `time.min` | [Time](#date-formats) | | If defined, this will override the data minimum
| `time.parser` | `String` or `Function` | | Custom parser for dates. [more...](#parser)
| `time.round` | `String` | `false` | If defined, dates will be rounded to the start of this unit. See [Time Units](#time-units) below for the allowed units.
| `time.tooltipFormat` | `String` | | The moment js format string to use for the tooltip.
| `time.unit` | `String` | `false` | If defined, will force the unit to be a certain type. See [Time Units](#time-units) section below for details.
| `time.stepSize` | `Number` | `1` | The number of units between grid lines.
| `time.minUnit` | `String` | `'millisecond'` | The minimum display format to be used for a time unit.

### Time Units

The following time measurements are supported. The names can be passed as strings to the `time.unit` config option to force a certain unit.

Expand Down Expand Up @@ -55,20 +73,20 @@ var chart = new Chart(ctx, {
})
```

## Display Formats
### Display Formats
The following display formats are used to configure how different time units are formed into strings for the axis tick marks. See [moment.js](http://momentjs.com/docs/#/displaying/format/) for the allowable format strings.

Name | Default
--- | ---
millisecond | 'SSS [ms]'
second | 'h:mm:ss a'
minute | 'h:mm:ss a'
hour | 'MMM D, hA'
day | 'll'
week | 'll'
month | 'MMM YYYY'
quarter | '[Q]Q - YYYY'
year | 'YYYY'
Name | Default | Example
--- | --- | ---
millisecond | 'h:mm:ss.SSS a' | 11:20:01.123 AM
second | 'h:mm:ss a' | 11:20:01 AM
minute | 'h:mm a' | 11:20 AM
hour | 'hA' | 11AM
day | 'MMM D' | Sep 4
week | 'll' | Sep 4 2015
month | 'MMM YYYY' | Sep 2015
quarter | '[Q]Q - YYYY' | Q3 - 2015
year | 'YYYY' | 2015

For example, to set the display format for the 'quarter' unit to show the month and year, the following config would be passed to the chart constructor.

Expand All @@ -91,7 +109,44 @@ var chart = new Chart(ctx, {
})
```

## Parser
### Scale Distribution

The `distribution` property controls the data distribution along the scale:

* `'linear'`: data are spread according to their time (distances can vary)
* `'series'`: data are spread at the same distance from each other

```javascript
var chart = new Chart(ctx, {
type: 'line',
data: data,
options: {
scales: {
xAxes: [{
type: 'time',
distribution: 'series'
}]
}
}
})
```

### Scale Bounds

The `bounds` property controls the scale boundary strategy (bypassed by min/max time options)

* `'data'`: make sure data are fully visible, labels outside are removed
* `'ticks'`: make sure ticks are fully visible, data outside are truncated

### Ticks Source

The `ticks.source` property controls the ticks generation

* `'auto'`: generates "optimal" ticks based on scale size and time options.
* `'data'`: generates ticks from data (including labels from data `{t|x|y}` objects)
* `'labels'`: generates ticks from user given `data.labels` values ONLY

### Parser
If this property is defined as a string, it is interpreted as a custom format to be used by moment to parse the date.

If this is a function, it must return a moment.js object given the appropriate data value.
If this is a function, it must return a moment.js object given the appropriate data value.
Loading