动态添加刻度标记? [英] Dynamically adding scale markers?

查看:104
本文介绍了动态添加刻度标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有任何方法可以在绘制图形之后动态添加scale-x标记,也许是通过类似这样的功能来实现的:

I was wondering if there was any way to dynamically add scale-x markers AFTER the graph has been rendered, perhaps via a function like-so:

zingchart.exec('myChart', 'addscalexmarker', {
    type: "line",
    range: 14,
    label: {
        text: "label!! yay!"
    }
}

我似乎想不出其他任何方法使它正常工作……谢谢!!

I can't seem to figure out any other way to get this to work... Thanks in advance!

推荐答案

尽管ZingChart拥有大量API方法,允许用户修改图表的不同部分,但并非每个属性都可以通过命名方法来访问.

While ZingChart does have a large range of API methods to allow users to modify different pieces of a chart, not every attribute is accessible through a named method.

我的建议是使用 setdata 方法,该方法是一种通用的API方法,用于修改图表的JSON.图表状态的管理将在ZingChart外部进行,但更新将通过单个 setdata 方法调用进行处理.

My suggestion would be to use the setdata method which is a catch-all API method to modify the chart's JSON. The management of the chart's state would be external to ZingChart, but updates would be handled with a single setdata method call.

   zingchart.exec('myChart', 'setdata',{
     data : myConfig
   });

工作演示: http://demos.zingchart.com/view/BG8SXI4W

我在ZingChart团队中工作-如果您还有其他问题,请告诉我.

I am on the ZingChart team -- let me know if you have any further questions.

这篇关于动态添加刻度标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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