/
Andr
/
asset-allocation
Обзор
Документация
Войти
/
Andr
/
asset-allocation
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
makePlot.js
30 строк
824 B
amchercashin
add simulation
15 фев 2019, 18:48
15 фев 2019, 18:48
db4ea49
Код
Авторство
О чём код?
function addBlankPlot(plotDiv) { Plotly.newPlot(plotDiv, [], {showlegend: true, legend: {"orientation": "h"}}); Plotly.newPlot("simDiv", [], {legend: {"orientation": "h"}}); } function addTracesToPlot (plot, indices) { for (index of indices) { let trace = makeTrace(index); Plotly.addTraces(plot, trace); console.log("Add blank trace: " + index); } Plotly.addTraces(plot, ipc); //Plotly.relayout(plot, {showlegend: true, legend: {"orientation": "h", x: 0.5, y: -0.1}}) return true; } function makeTrace(index) { let trace = {}; trace.type = "scatter"; trace.name = index; trace.x = []; trace.y = []; trace.marketDay = []; trace.transforms = [{ type: 'sort', target: 'x', order: 'ascending' }]; return trace; }