I am using DotNet.Highcharts in conjunction with Visual Studio 2010. I have created an array of Series:
List<Series> allSeries = new List<Series>();
I then looped through a database and added several different Series. Then I created a Highchart and need to add the allSeries list to it. I have the code below that I used to create a Series one at a time. How can I take the allSeries list and pass it to SetSeries?
.SetSeries(new[]
{
new Series { Name = "Combiner 2", Data = new Data(myData2) },
new Series { Name = "Combiner 3", Data = new Data(myData3) }
});
if I am left to assume that the
myData2andmyData3objects are contained in or could be extracted fromallSeries, then you should be able to do something like this:EDIT:
If set series isn’t looking for an
IEnumerable<Series>but instead needsObject[]orSeries[], then you could do this:or maybe this:
it all depends on what the method signature for
SetSeriesis.