NVD3 - 显示空图,而不是noData消息 [英] NVD3 - Showing empty chart instead of noData message

查看:163
本文介绍了NVD3 - 显示空图,而不是noData消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当没有要显示的数据时,是否有方法可以显示空图表,而不显示无数据可用消息?

Is there a way to show an empty chart instead of the "No Data Available" message when there is no data to show?

http://jsfiddle.net/sammla/pYWkD/2/

data2 = [ 
    { 
      "key" : "A key" , 
      "values" : []
    }

];


$ b

谢谢!

Thanks!

推荐答案

您可以通过包含空数组的空数组hack:

You can "hack" this by having an empty array that contains an empty array:

data2 = [ 
  { 
    "key" : "A key" , 
    "values" : [[]]
  }
];

这篇关于NVD3 - 显示空图,而不是noData消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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