Jump to content
Software FX Community

Dynamic creation of a series


User (Legacy)

Recommended Posts

I am porting an application from 6.2 VS2005.

This application created series and panes on the fly through code.

It no longer seems possible to add a series dynamically. Although it works

in the init code of a form, it no longer functions after the .EndInit

sequence in the Designer generated code:

I built a chart with 3 series / 3 Panes

//Works - add 4th pane

ChartFX.WinForms.SeriesAttributes seriesAttributesTT1 = new

ChartFX.WinForms.SeriesAttributes();

this.chart1.Series.Add(seriesAttributesTT1);

// EndInit also resets the series count to the original number of 3

((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();

//Fails - does not add the series

ChartFX.WinForms.SeriesAttributes seriesAttributesTT2 = new

ChartFX.WinForms.SeriesAttributes();

this.chart1.Series.Add(seriesAttributesTT2);

Tom Scharf

Link to comment
Share on other sites

Dear Tom,

You need to set chart1.Data.Series to 4 BEFORE you add the 4th series.

chart1.Data.Series = 4;

SeriesAttributes seriesAttributesTT2 = new SeriesAttributes();

chart1.Series.Add(seriesAttributesTT2);

I clearly see the confusion and I will bring it up in a discussion as to how

we should address this issue.

Regarding your other statement "It no longer seems possible to add a series

dynamically" I think are referring to the fact that you can no longer just

ask for a seriesattributes at index 4 and expect it to be there. You HAVE to

physically ADD the item in the collection for and this change is throughout

chartfx.

-c

"Tom Scharf" <tscharf@scharfengXXX.com> wrote in message

news:7gdgshs$FHA.4016@webserver3.softwarefx.com...

>I am porting an application from 6.2 VS2005.

>

> This application created series and panes on the fly through code.

>

> It no longer seems possible to add a series dynamically. Although it

> works in the init code of a form, it no longer functions after the

> .EndInit sequence in the Designer generated code:

>

> I built a chart with 3 series / 3 Panes

> //Works - add 4th pane

>

> ChartFX.WinForms.SeriesAttributes seriesAttributesTT1 = new

> ChartFX.WinForms.SeriesAttributes();

>

> this.chart1.Series.Add(seriesAttributesTT1);

>

> // EndInit also resets the series count to the original number of 3

>

> ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();

>

> //Fails - does not add the series

>

> ChartFX.WinForms.SeriesAttributes seriesAttributesTT2 = new

> ChartFX.WinForms.SeriesAttributes();

>

> this.chart1.Series.Add(seriesAttributesTT2);

>

>

>

> Tom Scharf

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...