Chart.js: Feature: Make ranges for tick auto generation configurable

Created on 11 Aug 2017  路  13Comments  路  Source: chartjs/Chart.js

This is against master (with or without #4545)- notice the Q3 in the _middle_ of the year as well as the thicker first gridline:

screen shot 2017-08-11 at 16 29 32

Here's the associated fiddle: http://jsfiddle.net/andig2/sexq35rn/2/

Looks like an issue with determiniNotice that depends on width of the chart. Maybe the behaviour should already be addressed by any of the open PRs?

help wanted time scale enhancement

All 13 comments

The ticker first grid line should be fixed in #4545, I don't know about the Q3 positioning

Not fixed by #4545, just retested :(

You right, #4545 fixed it only for the case of options.offset === gridLines.offsetGridLines

Might be fixed by #4117 then :) (@Zamaroth is about to rewrite it)

4117 seems to take care of the line formatting: http://jsfiddle.net/andig2/vLgosao7/ but introduces two new problems (I can migrate this comment there):

  • gridline formatting is bc break with current implementation (y axes in the example), this might be fixable by looking at the docs

    • doesn't respect min/max settings on the x axis

the implementation is gonna change and I can assure you it's gonna enable you to change the look of the first horizontal gridLine

I don't know about the Q3 positioning

Figured that one out. Its actually correct- middle of the year is the start of the third quarter. It just looks very weird, more so since q2 and q4 are not displayed. Imho this "quarter style" default formatting is more confusing than helpful?

ping @simonbrunel

@andig we should maybe provide a way to customize the available ranges for tick auto generation.

Sounds like a good idea, updated title

The first gridline problem is btw also noticable in the time scale point data example.

Thicker first grid line - Fixed by #4700.

Quater style labels - Fixed by #4777 skipping quarters and weeks during the auto tick generation. Because this fiddle is using the master build, now you will see ticks at a 3-month interval with Mar, Jun, Sep and Dec when you make the window larger. If ticks.major.enabled is set to true, ticks will be aligned to the beginning of year like 2015, Apr, Jul and Oct.

If ticks.major.enabled is set to true, ticks will be aligned to the begging of year like 2015, Apr, Jul and Oct.

This is somewhat true today. It will align the first major label. To align all of them we need https://github.com/chartjs/Chart.js/pull/6274

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adriantombu picture adriantombu  路  3Comments

gouthamrv picture gouthamrv  路  3Comments

gabrieldesouza picture gabrieldesouza  路  3Comments

joebirkin picture joebirkin  路  3Comments

nanospeck picture nanospeck  路  3Comments