refactor: add init option for chart
This commit is contained in:
parent
9842c79402
commit
8fc03c4a72
1 changed files with 15 additions and 0 deletions
15
web/index.js
15
web/index.js
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue