My current charts will error out if there is no data. I guess the EmptyChartText property means nothing.
I would like to hide the chart when it errors out. Is there an event or something that I can check?
What is the purpose of EmptyChartText if it never displays?
FYI: the error is about requiring at least one row...
EmptyChartText is displayed when the data source hasn't been assigned to the chart.
You can handle InvalidDataReceived event, which fires when the chart has been bound to invalid data (wrong data or no data at all, but the datasource has been set)
I tried the following, without success:___________________________________ Protected Sub cht2Small_InvalidDataReceived(ByVal sender As Object, ByVal e As Infragistics.UltraChart.Shared.Events.ChartDataInvalidEventArgs) Handles Cht2Small.InvalidDataReceivedMe.Cht2Small.DataSource = Nothing Me.Cht2Small.DataBind() End Sub___________________________________
I had thought that if I detected invalid data, I could set the datasource to nothing and then the EmptyChartText would display. Unfortunately, it had no effect. I also tried to set the chart's Visible Property to false, but that had no effect either.
Any suggestions?
This works on my machine: I get the empty chart message if i set the datasource to nothing in my InvalidDataReceived handler. Can you put a break point to make sure the event fires? What version of netadvantage are you using in your application? Also, what do you see on the screen when you run you app?
I'm using NetAdvantage 2009 for .Net 3.5 (just downloaded it yesterday). Using VB2008 on Vista-Business 32-bit.
The breakpoint shows that the event fires, but I don't get my own version of the EmptyChartText, and the chart is still visible (even though the debug step-thru shows the visible property being set to false).
I see the message, "Line Chart Error: You must have at least one row and one numeric column"
FWIW, I have the same problem with a 3D Pie chart. This was also a problem in NAS 2008.3 (and probably prior).
Sorry, I erroneously tested this with win chart instead of web chart. This scenario wouldn't work as nicely as it would with win chart. Setting Visible property will have no effect, as the renderer has already been called at the time of this event. For the original empty chart message try the following in the InvalidDataReceived handler:e.Text = myChart.EmptyChartText
Perfect--that's exactly what I needed. Thanks