Dojo + Highcharts. The X Axis is not alligned when setCategories() is executed

南楼画角 提交于 2019-12-11 19:29:30

问题


I am using Dojo and Highcharts, the X axis is not alligned when I use:

....xAxis[0].setCategories(...)

http://jsfiddle.net/xKfU2/6/

In the fiddle, if you comment the first setCategories and you discomment the second one, the X axis is allign, but the chart no. And if you discomment the both of them, you have the both problems.

How can I solve this problem? Thanks in advance.


回答1:


I'm not sure why the problem is occurring, but you can fix it by forcing the x-axis offset like this:

xAxis : {
     offset:0
},

http://jsfiddle.net/SSmtN/

I don't think that you should have to do this. Maybe it's a problem related to using dojo ?




回答2:


I found this solution too (replace the dojo adapter). I replaced this:

<script type="text/javascript" src="http://www.dojotoolkit-fr.org/wp-content/uploads/dojo-adapter.js"></script>

for this:

<script src="http://code.highcharts.com/adapters/standalone-framework.js"></script>

and now goes correctly without doing this:

xAxis : {
 offset:0},

See --> http://www.highcharts.com/component/content/article/2-news/58-highcharts-standalone-framework



来源:https://stackoverflow.com/questions/18532352/dojo-highcharts-the-x-axis-is-not-alligned-when-setcategories-is-executed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!