0

I haven't been able to find if there is a better way to do this - I am creating a timeline bar in ChartJS for tracking certain repeating occasions (ie. pruning a plant during dormancy). I'm recording the dates with the year, but I want them all to be collapsed into a single timeframe. I can convert all the dates to the same year to keep them within my Jan-Dec timeframe, but I was wondering if there is a more efficient way to just ignore years in ChartJS than doing the conversion on every single date every time the chart is refreshed.

I'm guessing that if there were a way to do this, it would be somewhere in this scale part of ChartJS's options, but I can't find any documentation.

Someone asked a similar question 3 years ago with no response

scales: {
      x: {
        min: '2022-01-01',
        max: '2022-12-31',
        type: 'time',
        time: {
          displayFormats: {
            month: 'MMM'
          },
          unit: 'month'
        }
      },

Image for clarity on what I'm working with

0 Answers0