yokin = [100000]; for (var i = 0; i < 10; i++) { var risoku = (yokin[i] * riritsu); yokin.push(yokin[i] + risoku); } var trace1 = { y: yokin, mode: 'lines+markers', type: 'scatter' }; var layout = { title:"FUKURI KEISAN", xaxis: {title:"Year"}, yaxis: {title:"Yokin[YEN]"} } var data = [trace1]; Plotly.newPlot('myDiv', data, layout); } </script>