vue-plotly icon indicating copy to clipboard operation
vue-plotly copied to clipboard

Question: using of methods

Open joeSaad opened this issue 5 years ago • 1 comments

Question: How do I use react method and redraw? I am having the data updated with another fetch from the backend but it is not reflecting the change in the chart.

Thanks

joeSaad avatar Aug 02 '19 14:08 joeSaad

<vue-plotly
                        :data="plotTelems(inv.telems)"
                        :layout="layout"
                        :options="layouts.options"
                      />

plotTelems(data) {
      let time = data.map(a => a.time);
      let foo= data.map(a => a.foo);
      let trace1 = {
        name: "foo",
        x: time,
        y: foo,
        type: "scatter",
        yaxis: "y"
      };
      let pData = [trace1];
      return pData);
    },

If you give example i could help you more

nicomoya123 avatar Aug 15 '19 13:08 nicomoya123