Jump to content
Software FX Community


User (Legacy)

Recommended Posts

If you have a chart on a tabPage which is not visible and you set the chart

values, when the chart is shown (the tabPage is selected) the values are not



1. Create new WinForms app

2. Place a 2 page tabPage control on the form

3. Place the chart on the second page (the one not visible when running app)

4. Place a button on the first page

5. Place the following code in the Button_Click event...

for (int x=0; x<chart1.NValues; x++)

chart1.Value[0,x] = x;

Run the app.... press the button and then select the second tabPage...

FYI: If you select the second tabPage and then go back to the first tabPage,

press the button the values are displayed in the chart!

PS. When is the next fix due... this is a flaw which is causing considerable



Link to comment
Share on other sites

There are two different thing wrong with this code:

1) You are not calling OpenData and CloseData as specified in the docs.

2) If this chart was never initialized, it has no data, random data

generation will be delayed until first paint for optimization purposes, so

that in real-life situations where you set the data before the chart is

displayed, the data is set only twice. For this reason, asking for NValues

before the chart is either display or initialized with data will return ZERO




Software FX, Inc.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...