refactor: add init option for chart

This commit is contained in:
vicanso 2021-12-26 12:05:44 +08:00
parent 9842c79402
commit 8fc03c4a72

View file

@ -5,6 +5,21 @@ var editor = CodeMirror.fromTextArea(document.getElementById("codeInput"), {
mode: "javascript"
});
editor.setSize("100%", height);
editor.setValue(`option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [150, 230, 224, 218, 135, 147, 260],
type: 'line'
}
]
};`);
function run() {
var option = editor.getValue();