x axis unit value changes not reflecting on graph

26 Views Asked by At

I am trying to change unit of x axis time scale on dropdown change but graph is not displaying as per the changed unit. Below is the code where this.unit is 'minute' or 'hour' or 'day' or 'week'

 this.lineChartOptions.scales.x = {
        type: 'time',
        time: {
          unit: this.unit,
          displayFormats: {
            minute: 'mm:ss',
            hour: 'HH:mm',
            day: 'MMM dd',
            week: 'MMM dd',
            month: 'MMM dd',
          },
          tooltipFormat: 'dd MMM hh:mm',
        },
      };

Tried to change linChartOptions, I can see the updated value in console for the unit but x axis labels are not formatting as per changed unit. It is taking initial value only.

0

There are 0 best solutions below