I have some issue with htlm element and plotly?

0 favourites
  • 2 posts
From the Asset Store
🙌 Element Magic Hit Sound Pack comes with 805 high-quality sound effect
  • We create some plotly graphics with this script javascript;

    const xArray = ['1.5','3','6','12','18'];
    const yArray = ['45','70','0','0','0'];
    // Define Data
    var data = [{
     x: xArray,
     y: yArray,
     mode: 'lines+markers',
     type: 'scatter'
    // Define Layout
    var layout = {
     xaxis: {range: [0,30], title: "Frecuencia"},
     yaxis: {range: [0,100], title: "Contraste Cromático"}, 
     title: "Sensibilidad cromática"
    // Display using Plotly
    Plotly.newPlot('myPlot', data, layout, {editable: true});

    We define a element HTML call myPlot and create the graphics, but for the yArray, is the value we need to change, how can change it into yArray.push() with another elements cause its doesnt works.

    For example i have 15 var for 15, cause from the yArray in the first positions could be three posibilities. 45,70,90 in five positions. How can it change in part of the written and take a effect for the plotly script.

    Because i dont wanna create 225 graphs like one case for one case.

    I want create a script to change the yArray with other script if the result is diffente here



  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This is the documentation for the library you are using.


    From giving it a quick look there is a method called Plotly.react that is meant for updating graphs after creating them.

    I think that is what you need.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)