用图像/文本替换图表的内容 [英] Replace contents of chart with image/text

查看:87
本文介绍了用图像/文本替换图表的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010附带的ASP.NET Charting控件。我已经能够获得我想要的图表。但是,集成它的系统存在一些数据不可用的情况。当数据不可用时,
我想显示图像或文本而不是图表。例如,包含"数据不可用于此可视化"的大字符串。

I am using the ASP.NET Charting controls shipped with Visual Studio 2010. I have been able to get the charts that I want working. However, the system in which this is integrated has some instances where the data is not available. When the data is not available, I'd like to show an image or text instead of the chart. For example, a large string containing "Data not available for this visualization".

有任何建议吗?

谢谢,

Erick

Thanks,
Erick

推荐答案

假设你有一个名为 noData 的布尔变量,你设置为true或者是假的,你是否有数据。

Let's say you had a boolean variable called noData, which you set to true or false, wether you have data or not.

你可以在页面上贴上标签,上面写着"数据不可用......"。并根据noData隐藏和显示它

You could simply have a label on the page with the text "Data not available..." and hide and show it depending on noData


	Me.lblNoData.Visible = noData
	Me.Chart1.Visible = Not noData


这篇关于用图像/文本替换图表的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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