Prevent dimple from renaming columns on redraw

痞子三分冷 提交于 2019-12-25 18:44:18

问题


I renamed my column names as explained here: dimple.js How can I change the labels of a chart axis without changing the data?

The problem is that the column names change back to default on redraw. I redraw on page resize with parameter noDataChange = true as shown in this example: http://dimplejs.org/advanced_examples_viewer.html?id=advanced_responsive_sizing

Any ideas on how to prevent reverting column names to default?

EDIT:

So far I've tried to rename the axes again on each resize, but they seem to change for a short period of time (during debugging) and then turn back to the column name in the data. What causes the axes' names to change on draw?


回答1:


My answer on the linked question is out of date, in more recent versions of dimple the alternate answer is now the preferred way to do it.

Set the title before drawing:

...
x = chart.addCategoryAxis("x", "My Dimension");
x.title = "My Awesome New Title";
chart.draw();


来源:https://stackoverflow.com/questions/38373062/prevent-dimple-from-renaming-columns-on-redraw

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