Closed quiquelhappy closed 1 month ago
the first column (the one that is overlapping) should be on the latest column (sunday).
const dailyFormat = 'dd' const weeklyFormat = 'YY/WW (MMM)' const isoWeekday = 1; const grid = { display: false, drawBorder: false, tickLength: 0, } const ticks = { maxRotation: 0, autoSkip: true, padding: 1 } const x = { type: 'time', offset: true, time: { isoWeekday, unit: 'day', round: 'day', parser: dailyFormat, displayFormats: { day: 'dd' } }, reverse: false, position: 'right', ticks, grid, min: moment().startOf('isoWeek'), max: moment().endOf('isoWeek') } const y = { type: 'time', offset: true, reverse: true, time: { isoWeekday, unit: 'week', round: 'week', displayFormats: { week: weeklyFormat } }, ticks, grid, }
these settings are being used on the options object:
scales: { x, y },
data:
data: s.data.map(d => { const k = d.key as Date // valid const day = moment(k).format(dailyFormat) const date = moment(k) return { x: day, y: date, d: k, v: d.data[l] } })
You'd probably want to be using 'E' as dailyFormat, which would yield ISO day of week from 1 to 7.
'E'
the first column (the one that is overlapping) should be on the latest column (sunday).
these settings are being used on the options object:
data: