Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotly with API #24

Open
ddiegommachado opened this issue Sep 10, 2019 · 1 comment
Open

Plotly with API #24

ddiegommachado opened this issue Sep 10, 2019 · 1 comment

Comments

@ddiegommachado
Copy link

Hi everyone,

I need mount a graph with data of the a API. I'm using https://github.com/statnett/vue-plotly
My code is:

<vue-plotly :data="data" :layout="layout" :options="options" />
<script>
import axios from "axios";
import VuePlotly from "@statnett/vue-plotly";

export default {
  components: {
    VuePlotly
  },
  data() {
    return {
      fields: [],
      data: [{ x: [], y: [] }],
      layout: {},
      options: {},
      responsive: true
    };
  },
  mounted() {
    var url = "http://www.mocky.io/v2/5d77aa2f3200005b00923f71";

    axios.get(url).then(r => {
      this.fields = r.data.fields;
    });
  }
};
</script>

How make this?

@glorat
Copy link

glorat commented Jan 15, 2020

<vue-plotly> references data, layout and options. There is no reference to fields so it is not surprising it does nothing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants