加载回调时的C3图形 [英] C3 Graphs On Load Callback

查看:93
本文介绍了加载回调时的C3图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用某种回调函数,该函数将在C3图形完成加载后运行一些代码,以便我可以更改某些点的填充颜色.

I want to use some kind of callback function that will run some code once the C3 Graph is finished loading so that I can change the fill colors of certain points.

推荐答案

不要在初始化中加载任何数据.而是显式调用load事件并传递数据.然后,您可以访问done回调.

Don't load any data in the initialization. Rather explicitly call the load event and pass the data in. Then you have access to the done callback.

var chart = c3.generate({ /*...*/ });

chart.load({
  columns: [['data1, 100, 200, 150, ...],
    ...
  ],
  done: function() { /* whatever you need done here... */}
});

这篇关于加载回调时的C3图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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