kyper-data / python-highcharts

A simple translation layer between Python and Javascript for Highcharts projects (highcharts, highmaps, and highstocks).
MIT License
393 stars 190 forks source link

Broken in the 7.0.0 release today #61

Closed ujjwalkumar closed 5 years ago

ujjwalkumar commented 5 years ago

Python-Highcharts isn't working after the 7.0.0 release today (the examples don't work as well). Is it possible to use v6 of highcharts, while the issue is fixed? Thanks

Below is the error in console - highstock.src.js:28370 Uncaught TypeError: (d.series || []).forEach is not a function at a.Chart.firstRender (VM317 highstock.js:283) at a.Chart. (VM317 highstock.js:258) at a.fireEvent (VM317 highstock.js:31) at a.Chart.init (VM317 highstock.js:256) at a.Chart.getArgs (VM317 highstock.js:256) at new a.Chart (VM317 highstock.js:256) at new a.StockChart.a.stockChart (VM317 highstock.js:564) at HTMLDocument. (VM349 about:srcdoc:1) at c (VM314 jquery.min.js:3) at Object.fireWith [as resolveWith] (VM314 jquery.min.js:3)

tzzh commented 5 years ago

@ujjwalkumar I have the same issue a temporary fix could be to override the JSsource property so it points to the previous version eg something like

from highcharts import Highstock
h = Highstock()
h.JSsource = [
                'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js',
                'https://code.highcharts.com/stock/6/highstock.js',
                'https://code.highcharts.com/stock/6/modules/exporting.js',
                'https://code.highcharts.com/6/highcharts-more.js',
            ]
pravu87 commented 5 years ago

Same issue here as well

highcharts.src.js:28370 Uncaught TypeError: (e.series || []).forEach is not a function at a.Chart.firstRender (highcharts.src.js:28370) at a.Chart. (highcharts.src.js:26516) at a.fireEvent (highcharts.src.js:2610) at a.Chart.init (highcharts.src.js:26382) at a.Chart.getArgs (highcharts.src.js:26353) at new a.Chart (highcharts.src.js:26287)

TorsteinHonsi commented 5 years ago

The cause of this issue is that python-highcharts generates an empty series object {}, while Highcharts requires an array []. In v7 we started using [].forEach instead of our own abstractions, so this caused a regression.

}, "series": {}, "labels": {}, "chart": {"renderTo": "containe

We have reported and fixed this in https://github.com/highcharts/highcharts/issues/9680, and will release Highcharts v7.0.1 within one or two days.

Instead of downgrading Highcharts to v6.2, I would request you to fix the underlying issue, so that your generator produces an empty array. For existing clients, the issue will disappear as we upload v7.0.1 to code.highcharts.com.

Thanks!