Highcharts stock chart dependency 404 error? #279
-
I've been trying to implement the stock chart using this fiddle from the highchart documentation. But I can't seem to get it to work. All it shows is the normal bar chart: This is the code i'm using: from random import randint
from nicegui import ui
chart = ui.chart(extras=['stock'],
options={
'chart': {
'type': 'line'
},
'rangeSelector': {
'selected': 4
},
'plotOptions': {
'series': {
'showInNavigator': "true"
}
},
'series': [{'data': [0, 2, 3, 6, 8, 10]}]
}).classes('w-full h-64')
def update():
chart.options['series'][0]['data'].append(randint(0, 100))
chart.update()
ui.button('Update', on_click=update)
ui.run() The chrome dev tools seem to show that the stock dependency fails to import and can't be found:
I am running nice gui 1.13 with a new clean venv of python 3.11. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for reaching out, @Mantanium! First of all: The 404 errors are not related. When opening the developer console the browser tries to load *.js.map files, which are (currently) not provided by NiceGUI. We are still undecided if and how we would want to do that. For now, you can simply ignore these errors. But you are expecting to see something like this and not a plain line plot. I think the reason is that |
Beta Was this translation helpful? Give feedback.
Thanks for reaching out, @Mantanium!
First of all: The 404 errors are not related. When opening the developer console the browser tries to load *.js.map files, which are (currently) not provided by NiceGUI. We are still undecided if and how we would want to do that. For now, you can simply ignore these errors.
But you are expecting to see something like this and not a plain line plot. I think the reason is that
ui.chart()
callsHighcharts.chart()
and notHighcharts.stockChart()
. Somehow we need to integrate this option into the API. I'll create an issue from this discussion: #284