Page 1 of 1

No chart display at runtime after chart created at design

Posted: Fri Nov 11, 2016 4:02 pm
by 15677630
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.

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

Posted: Mon Nov 14, 2016 8:50 am
by Christopher
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();

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

Posted: Mon Nov 14, 2016 1:56 pm
by 15677630
Thanks!