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
Thanks