Skip to content

Commit

Permalink
Allow specifying labels in time scale options
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed May 8, 2019
1 parent ddee91e commit dc4f183
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/axes/cartesian/time.md
Expand Up @@ -149,7 +149,7 @@ 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
* `'labels'`: generates ticks from user given `scale.labels` or `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.js to parse the date.
Expand Down
2 changes: 1 addition & 1 deletion src/scales/scale.time.js
Expand Up @@ -524,7 +524,7 @@ module.exports = Scale.extend({
var datasets = [];
var labels = [];
var i, j, ilen, jlen, data, timestamp;
var dataLabels = chart.data.labels || [];
var dataLabels = options.labels || chart.data.labels || [];

// Convert labels to timestamps
for (i = 0, ilen = dataLabels.length; i < ilen; ++i) {
Expand Down

0 comments on commit dc4f183

Please sign in to comment.