Time.unit property is being ignored/not working correctly in the latest version (2.7.2).

In the latest version – 2.7.2 – the “unit” property in time scale is not working. In version 2.6.0 is working just fine.

Working (2.6.0): Fiddle
Not working (2.7.0) :Fiddle.

Here the time unit is set to “month”, but it is being ignored/not working correctly in the latest version. If one changes to the previous version, 2.6.0, the problem goes away.

options: { scales: { xAxes: [{ type: 'time', time: { displayFormats: { 'millisecond': 'MMM DD', 'second': 'MMM DD', 'minute': 'MMM DD', 'hour': 'MMM DD', 'day': 'MMM DD', 'week': 'MMM DD', 'month': 'MMM DD', 'quarter': 'MMM DD', 'year': 'MMM DD', }, unit:'month' } }], }, }

Author: Fantashit

1 thought on “Time.unit property is being ignored/not working correctly in the latest version (2.7.2).

  1. time.unit is not ignored but since your minimum range includes all your data (< 1 month), then ticks are not displayed because out of the view. You need to set scale.bounds: 'ticks' to make sure your range is fully displayed (fiddle). This behavior has changed in 2.7.0 (#4556).

Comments are closed.