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
1730
chart series limitation
posted

Hi,

What is the limitation of number of series to be rendered on a chart. I have multiple series(45 in number), each series containing 300-400 data points for a single chart.

I am using a loop to render series as shown below:

@for(int i=0;i<50;i++)

{
             var grp = Model.Data[i];

            @(Html.Infragistics().DataChart(Model.Data)
                      .ID("testChart")

                      .VerticalZoomable(true)
                      .HorizontalZoomable(true)
                      .OverviewPlusDetailPaneVisibility(Visibility.Visible)

                      .Legend(legend => legend.ID("legend1"))

                      .Axes((axes) =>
                      {
                            axes.NumericX("xAxis")
                            axes.NumericY("yAxis")
                       })

                       .Series(series =>
                       {
                           series.ScatterLine("scatterSeries" + i.ToString(), grp)

                           .XAxis("xAxis").YAxis("yAxis")

                           .XMemberPath(data => data.X)
                           .YMemberPath(data => data.Y)

                           .MarkerBrush("Red")

                           .ShowTooltip(true)
                           .Thickness(7)
                           .TooltipTemplate("tipTemplate1");
                     })
                 .DataBind()
                 .Render()
      )

}

After i values goes over 10, I get Out of memory exception in js file. ANy ideas why this is happening ??

Looks like there is some limitation on the number of series, a chart can Render.

  • 30692
    Suggested Answer
    Offline posted

    Hi, you received my answer through Developer Support, correct? Your problem is that you are assigning a new chart level data source each time you are adding a series, and each time that chart level source contains ALL the data, and is reserialized each time. You don't need to do this since you are setting the appropriate data source on each series in the loop. 

    There is no limitation for the number of series you can put in the chart, but eventually you will run out of memory or CPU cycles. Memory first, probably. But your problem was being exacerbated here by reserializing all the data every loop iteration.