Jehanzeb Posted April 1, 2007 Report Share Posted April 1, 2007 Hello All, I am using two types pf charts; Pie Chart and Horizontal Bar Negative Value charts. When the application starts, I want to show empty charts in both of these cases. For example, in case of pie chart, I don't want that the pie chart with default data (the one displayed on design time) is shown. The chart should be drawn when the user select a few options and press the display chart button. Thanks in advance. Regards,Jehanzeb Quote Link to comment Share on other sites More sharing options...
Frank Posted April 1, 2007 Report Share Posted April 1, 2007 Simply call: chart.Data.Clear(); In your form load. Quote Link to comment Share on other sites More sharing options...
Jehanzeb Posted April 2, 2007 Author Report Share Posted April 2, 2007 Hello, Thanks for your prompt reply. The problem is that I am using the chart control in a UserControl. So, can you please tell me whether it's fine to call chart.Data.Clear() in the Load event of the UserControl. I have written the same code in the Initialize method of my UserControl but it's not working. Regards, Jehanzeb Quote Link to comment Share on other sites More sharing options...
Frank Posted April 2, 2007 Report Share Posted April 2, 2007 It all depends where you are creating your chart. If you are creating your chart at design-time then the Load event is fine. Bottom-line is you wan to call this as late as possible before paint, after you have customize everything you want in your chart. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.