User (Legacy) Posted December 11, 2005 Report Share Posted December 11, 2005 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 More sharing options...
Software FX Posted December 12, 2005 Report Share Posted December 12, 2005 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 More sharing options...
Software FX Posted December 12, 2005 Report Share Posted December 12, 2005 To add a series dynamically do: chart.Data.Series++; You do not need to add it to the Series Attributes collection (chart.Series), the Series Attributes collection is automatically synchronized with the number of series in the data. -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.