title: Custom time in chart.js streaming plugin
body: <p>I'm struggling with changing default realtime from streaming plugin for chart.js. Only what I need is &quot;moving chart&quot; which refresh data every 1 second and display my data on X and Y axis.</p>
  <p><a href="https://i.stack.imgur.com/TdOIZ.png" rel="nofollow noreferrer">My chart</a></p>
  <p>Ultimately I want to display the simulation time from the simulink model in seconds. I have the actual time in my vuex so just need to somehow convert the realtime to time from the simulation.</p>
  <pre><code>    simuTime() {
          return this.$store.getters.simulationTime
      }
    },
    mounted() {
      const ctx = this.$refs.mychart
      const data = {
          labels: [],
          datasets: [
              {
                  label: &quot;Mains_1_Voltage&quot;,
                  data: [],
                  backgroundColor: &quot;rgba(54, 162, 235, 0.2)&quot;,
                  borderColor: &quot;rgba(75, 192, 192, 1)&quot;,
                  borderWidth: 1,
              },
              {
                  label: &quot;Mains_1_Frequency&quot;,
                  data: [],
                  backgroundColor: &quot;rgba(248, 109, 181, 1)&quot;,
                  borderColor: &quot;rgba(163, 109, 181, 1)&quot;,
                  borderWidth: 1,
              },
          ],
      }
      var config = {
          type: &quot;line&quot;,
          data: data,
          options: {
              scales: {
                  x: {
                      type: 'realtime',
                      realtime: {
                          delay: 1000,
                          onRefresh: chart =&gt; {
                              chart.data.datasets[0].data.push({
                                  //this doesn't work after changing from Date.now()
                                  x: this.simuTime,
                                  y: this.V1[0].value
                              })
                              chart.data.datasets[1].data.push({
                                  //this doesn't work after changing from Date.now()
                                  x: this.simuTime,
                                  y: this.F1[0].value
                              })
                          }
                      }
                  },
                  y: {
                      beginAtZero: true,
                  },
              },
          },
      }
      const myChart = new Chart(ctx, config);
      myChart
      this.simu_time_interval = setInterval(() =&gt; {
          this.$store.dispatch('calculateSimulationTime')
      }, 500);
    },
    beforeUnmount() {
      clearInterval(this.simu_time_interval)
    }
  };
  </code></pre>