Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
975
not all dynamically added series are showing in my chart
posted

My chart may have 1 or more series, this is etermined from the underlying data, each series is created in javascript depending on the value of a property on my model.  This is how i create the chart

@(Html.Infragistics().DataChart(Model.EnergyProductPriceMatrix)
                                                    .ID("chart")
                                                    .Width("100%")
                                                    .Height("500px")
                                                    .Axes(axis =>
                                                    {
                                                        axis.CategoryX("DateAxis").Title("Date").Label(l => l.CloseDateAsString).Overlap(1.0).UseEnhancedIntervalManagement(true);
                                                        axis.NumericY("PriceAxis").Title("Price (£/MWh)").LabelLocation(AxisLabelsLocation.OutsideLeft);
                                                    })
                                                    .AnimateSeriesWhenAxisRangeChanges(true)
                                                    .WindowScaleHorizontal(5.0)
                                                    .WindowScaleVertical(5.0)
                                                    .HorizontalZoomable(true)
                                                    .VerticalZoomable(true)
                                                    .WindowResponse(WindowResponse.Immediate)
                                                    .ResponseDataKey("EnergyProductPriceMatrix")
                                                    .Render()
                                                )

and this is how i determine how many series I create

if (model.Series1EnergyProduct.length > 0)
            {
                $("#chart").igDataChart("option", "series", [{ name: model.Series1EnergyProduct, remove: true }]);
                $("#chart").igDataChart("option", "series", [{
                    type: "line",
                    name: model.Series1EnergyProduct,
                    title: model.Series1EnergyProduct,
                    xAxis: "DateAxis",
                    yAxis: "PriceAxis",
                    valueMemberPath: model.Series1ValuePathName,
                    isTransitionInEnabled: true,
                    isHighlightingEnabled: true,
                    thickness: 2,
                    brush: "#E01512",
                    showTooltip: true,
                }]);
            }
            if (model.Series2EnergyProduct.length > 0) {
                $("#chart").igDataChart("option", "series", [{ name: model.Series2EnergyProduct, remove: true }]);
                $("#chart").igDataChart("option", "series", [{
                    type: "line",
                    name: model.Series2EnergyProduct,
                    title: model.Series2EnergyProduct,
                    xAxis: "DateAxis",
                    yAxis: "PriceAxis",
                    valueMemberPath: model.Series2ValuePathName,
                    isTransitionInEnabled: true,
                    isHighlightingEnabled: true,
                    thickness: 2,
                    brush: "#e67e22",
                    showTooltip: true
                }]);
            }
            if (model.Series3EnergyProduct.length > 0) {
                $("#chart").igDataChart("option", "series", [{ name: model.Series3EnergyProduct, remove: true }]);
                $("#chart").igDataChart("option", "series", [{
                    type: "line",
                    name: model.Series3EnergyProduct,
                    title: model.Series3EnergyProduct,
                    xAxis: "DateAxis",
                    yAxis: "PriceAxis",
                    valueMemberPath: model.Serie3ValuePathName,
                    isTransitionInEnabled: true,
                    isHighlightingEnabled: true,
                    thickness: 2,
                    brush: "#cb4335",
                    showTooltip: true
                }]);
            }

the first 2 series display ok but the third doesnt despite there being data for it.  There are 21 points in the series, so 21 objects in the EnergyProductPriceMatrix.  Not all the points have values, some will be null.  Series 3 only has values in the last 3 entries, so I would only expect to see points plotted on the graph for these last 3, but there is nothing.  They are not out of range in date or value and should sit on the graph along with the other series but there is nothing.  Can anyone tell me why ? and how do I fix this ?  I may have anything from 1 up to 6 series on this graph in total and these will be determined at runtime

  • 2680
    Offline posted

    Hello Mark,

    Thank you for contacting us. I see you created two additional cases regarding other issues to your use case. Did you manage to solve the issues described in this thread or not?

    I am looking forward to hearing from you.