No chart display at runtime after chart created at design

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ysyeh
Newbie
Newbie
Posts: 2
Joined: Mon Feb 08, 2016 12:00 am

No chart display at runtime after chart created at design

Post by ysyeh » Fri Nov 11, 2016 4:02 pm

Environment: Windows 7 - VS2013 - Visual C# - .NET Framework 4.6.1 - Windows Forms Application with TeeChartNET2015_4.1.2015.12160

What I did:

1. Put a TChart component on Form1
2. Add a Bar Series with Data Source specified as 'Random'

The design time screen in IDE shows chart with 6 bars.

When I click 'Start' button on IDE screen, the runtime screen shows a form with blank TeeChart; no bar shows up.

Is this normal? I know if I add codes to initialize the chart I can get the 6 bars shown in runtime screen. But without codes should the 6 bars also show up when bar series is defined at design time only?

Thanks.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: No chart display at runtime after chart created at design

Post by Christopher » Mon Nov 14, 2016 8:50 am

ysyeh wrote: Is this normal? I know if I add codes to initialize the chart I can get the 6 bars shown in runtime screen. But without codes should the 6 bars also show up when bar series is defined at design time only?
Yes, this is normal. The reason is that a series at designtime is filled with random data by default, whereas at runtime it is left empty. To see the equivalent random data at runtime, you can add:

Code: Select all

bar1.FillSampleValues();
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

ysyeh
Newbie
Newbie
Posts: 2
Joined: Mon Feb 08, 2016 12:00 am

Re: No chart display at runtime after chart created at design

Post by ysyeh » Mon Nov 14, 2016 1:56 pm

Thanks!

Post Reply