justpy-org / justpy

An object oriented high-level Python Web Framework that requires no frontend programming
https://justpy.io
Apache License 2.0
1.18k stars 94 forks source link

candlestick chart showing gap in x-axis #362

Closed williamwongys closed 1 year ago

williamwongys commented 2 years ago

There is a bug resulting in the gaps in x-axis when using candlestick. I have reported the problem to highcharts and got this reply: "It seems that JustPy loads outdated and modified Highcharts package (all modules merged into one)." .

Please run the demo in the following link: https://replit.com/join/arfnpynkjy-williamwong15 by issuing the following command in the shell: uvicorn --host 0.0.0.0 --port 8000 main:app and you will see the problem.

You can also refer to the discussion thread in the following link: https://www.highcharts.com/forum/viewtopic.php?f=12&t=48112&p=174560#p174560

elimintz commented 2 years ago

I suggest setting the HIGHCHARTS configuration variable to false and adding the correct highcharts libraries using the head attribute of the WebPage

williamwongys commented 2 years ago

i am sorry, could you show the file and codes on how to do it? Thanks.

williamwongys commented 2 years ago

I added justpy.env, added HIGHCHARTS = False In my codes, I have added the following: HTML_HEADER = '''<script src="https://code.highcharts.com/stock/highstock.js"></script> <script src="https://code.highcharts.com/stock/modules/data.js"></script> <script src="https://code.highcharts.com/stock/modules/exporting.js"></script> <script src="https://code.highcharts.com/stock/modules/drag-panes.js"></script> <script src="https://code.highcharts.com/stock/modules/hollowcandlestick.js"></script> <script src="https://code.highcharts.com/stock/modules/export-data.js"></script>'''

wp = jp.WebPage(highcharts_theme='gray') wp.head_html = HTML_HEADER

A blank page shows up.

WolfgangFahl commented 1 year ago

This is a question that is mainly about the upgstream highcharts component and therefore a better fit for the larger stackoverflow community at https://stackoverflow.com/search?q=justpy - you might want to add the highchart tag when asking there.