英文:
Bar and line chart not working using chart JS
问题
我正在尝试制作一个包含许多图表的HTML报告。
每个图表都运行正常,除了一个名为“Surface Solar Radiation and Sunshine”的图表。
我已经尝试了一切来调试它并找出问题的原因,但无法解决它。
当我将不起作用的图表代码复制到一个单独的文件中并尝试运行它时,它可以正常工作,但一旦将其与其他图表放在一起,它就不起作用了。
代码太长了,所以这里是代码文档的链接:代码文档链接
正常工作的图表
如您所见,“Surface Solar Radiation and Sunshine”图表没有显示,而其他图表可见。
英文:
I am trying the make a html report that contain a lot of charts in it.
every chart is working fine
except the one chart Surface Solar Radiation and Sunshine.
I have tried everything debug it and to find the reason of the problem but could not resolve it.
When I copied that not working chart code into a separate file and tried to run it, it worked perfectly fine, but as soon as i kept it with other chart again it; not working
code is too long, so here is link of the code doc
working chart
As you can see that Surface Solar Radiation and Sunshine chart is not showing and other charts are visible
答案1
得分: 1
我已经看到了代码
你正在两次使用window.onload = function()
你应该将加载函数合并成一个图表然后使用它
它会起作用的
英文:
I have seen the code
you are using the window.onload = function() two time
you should combine the on load function in a one chart and then use it
it will work
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论