highcharts / highcharts-editor

https://www.highcharts.com/products/highcharts-editor
Other
248 stars 95 forks source link

Multi yAxises + Change Template raises error 'The requested axis does not exist!' #197

Open lovelyelfpop opened 5 years ago

lovelyelfpop commented 5 years ago

Expected behaviour

Chart type should be successfully changed

Actual behaviour

'The requested axis does not exist!' happened asdasd

Reproduction steps

1、use defaultChartOptions

highed.DrawerEditor(document.body, {
    defaultChartOptions: {
        "chart": {
            "type": "column",
            "polar": false
        },
        "title": {
            "text": "My Chart"
        },
        "subtitle": {
            "text": "My Untitled Chart"
        },
        "series": [{
            "name": "Tokyo",
            "turboThreshold": 0
        }, {
            "name": "New York",
            "turboThreshold": 0,
            "yAxis": 1
        }, {
            "name": "Berlin",
            "turboThreshold": 0
        }, {
            "name": "London",
            "turboThreshold": 0
        }],
        "yAxis": [{}, {}],
        "data": {
            "csv": "\"Categories\";\"Tokyo\";\"New York\";\"Berlin\";\"London\"\n\"Jan\";7;-0.2;-0.9;3.9\n\"Feb\";6.9;0.8;0.6;4.2\n\"Mar\";9.5;5.7;3.5;5.7\n\"Apr\";14.5;11.3;8.4;8.5\n\"May\";18.2;17;13.5;11.9\n\"Jun\";21.5;22;17;15.2\n\"Jul\";25.2;24.8;18.6;17\n\"Aug\";26.5;24.1;17.9;16.6\n\"Sep\";23.3;20.1;14.3;14.2\n\"Oct\";18.3;14.1;9;10.3\n\"Nov\";13.9;8.6;3.9;6.6\n\"Dec\";9.6;2.5;1;4.8",
        }
    },
});

Or Design a chart manually first

2、Change chart template

Editor version

0.2.2-rc3

lovelyelfpop commented 5 years ago

Comment these lines below in src\ui\highed.chartpreview.js seems works

/* if (customizedOptions.yAxis) { // line 525
    delete customizedOptions.yAxis;
}*/