Hi,
I have a problem because I can’t execute an UNION (or a Concat function) between 2 generic collection (System.Collections.Generic.IEnumerable`1[Cj]).
I have to create a unique structure with 3 static elements (volEntree, volSortie, volBypass) and a dynamic list of elements issus from : Query.GetDescendants(Entity,“Weir”).
The structure must contains a name and a value and then, with this structure, I want to build a bar chart like this :
I need to hold the elements in a unique structure in order to keep the proportionality on the chart.
So, I build this code (GetScalarIndicatorData and GetDataSamples return Time Series : Time and Value) :
<<var [volEntree = ScalarIndicatoDataSource.GetScalarIndicatorData("ComputeWasteWaterTreatmentPlantIncomingVolume","1.00:00:00")]>>
<<var [volSortie = ScalarIndicatoDataSource.GetScalarIndicatorData("ComputeWasteWaterTreatmentPlantTreatedVolume","1.00:00:00")]>>
<<var [volBypass = ScalarIndicatoDataSource.GetScalarIndicatorData("ComputeWasteWaterTreatmentPlantBypassVolume","1.00:00:00")]>>
<<var [categoriesBarGraphVolumes = new string[] { “Volume en entrée”, “Volume en sortie”, “Volume By-pass” }]>>
<<var [valuesBarGraphVolumes = new int[] {(int)volEntree.Sum(x => x.Value), (int)volSortie.Sum(x => x.Value), (int) volBypass.Sum(x => x.Value)}]>>
<<var [seq = new int[] { 0, 1, 2 }]>>
<<var [barGraphVolumes1 = seq.Select(i => new { nomSerie = categoriesBarGraphVolumes.Skip(i).First(), valSerie = valuesBarGraphVolumes.Skip(i).First() })]>>
<<var [barGraphVolumes2 = Query.GetDescendants(Entity,"Weir").Select(do => new { nomSerie = do[“Name”], valSerie = Query.GetDataSamples(do,"Flow.HourlyVolumeTimeSeries").Sum(x => x?.Value)})]>>
<<var [barGraphVolumes = barGraphVolumes1.Union(barGraphVolumes2)]>>
Do you have any ideas on how I could get around this or how I could manage to do this?
Thank you.
