防止酒窝重命名重绘列 [英] Prevent dimple from renaming columns on redraw

查看:97
本文介绍了防止酒窝重命名重绘列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按以下说明重命名了列名:

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

问题在于,列名在重绘时会变回默认值. 我使用参数noDataChange = true在页面调整大小上重绘,如以下示例所示: http://dimplejs. org/advanced_examples_viewer.html?id = advanced_sensitive_sizing

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?

到目前为止,我已经尝试在每次调整大小时都重新命名轴,但是它们似乎会在短时间内更改(在调试过程中),然后再返回到数据中的列名称. 是什么导致轴名称在绘制时更改?

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?

推荐答案

我对链接问题的答案已过期,在最新版本的dimple中,替代答案现在是首选的解决方法.

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.

在绘制前设置标题:

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

这篇关于防止酒窝重命名重绘列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆