Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8922413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:49:36+00:00 2026-06-15T06:49:36+00:00

I need to process large amount of data into a single List<ChartData> for my

  • 0

I need to process large amount of data into a single List<ChartData> for my custom control.
About 3 Million points it works fine after reaching the List Count 80,00,000 It throws the Out of memory error. Is there any count limit for List? Yes means shall I use any other Collection rather then the List.

Is there a better technique to load large amounts of data into memory?
The proplem is in the following function.If ChartIndexedDataPoint.Count is goes to above 30,00,000

 protected override void CalculateSegments(ChartSeries series, ChartIndexedDataPoint[] points)
    {
        double[] yCoef={0};
        IChartDataPoint startPoint = null;
        IChartDataPoint endPoint = null;
        ChartPoint startControlPoint = null;
        ChartPoint endControlPoint = null;
        if (points.Length >= 2)
        {
            NaturalSpline(points, out yCoef);
            if (series.ShowEmptyPoints == false && series.Area.EnableLazyLoading == true)
            {
                allpoints = new List<IChartDataPoint>();
                if (series.ActualYAxis.IsAutoSetRange == true || series.ActualXAxis.IsAutoSetRange == true)
                {
                    series.Segments.Clear();
                    series.Adornments.Clear();

                    for (int i = 0, count = points.Length; i < count - 1; i++)
                    {
                        startPoint = points[i].DataPoint;
                        endPoint = points[i + 1].DataPoint;
                        GetBezierControlPoints(startPoint, endPoint, yCoef[i], yCoef[i + 1], out startControlPoint, out endControlPoint);
                        allpoints.Add(startPoint);
                        allpoints.Add(startControlPoint);
                        allpoints.Add(endControlPoint);
                        allpoints.Add(endPoint);
                    }
                    series.Segments.Add(new ChartFastSplineSegment(allpoints, points, series)); 
                    return;
                }
                if (series.Segments.Count != 0)
                {
                    ChartFastSplineSegment segment = ((ChartFastSplineSegment)series.Segments[0]);

                    if (segment.Points != null && segment.Points.Count < points.Length)
                    {
                        segment.GetSegmet(points[points.Length - 1].DataPoint, series);
                    }
                    else if (segment.Points == null || segment.Points.Count > points.Length)
                    {                           
                        for (int i = 0, count = points.Length; i < count - 1; i++)
                        {
                            startPoint = points[i].DataPoint;
                            endPoint = points[i + 1].DataPoint;
                            GetBezierControlPoints(startPoint, endPoint, yCoef[i], yCoef[i + 1], out startControlPoint, out endControlPoint);
                            allpoints.Add(startPoint);
                            allpoints.Add(startControlPoint);
                            allpoints.Add(endControlPoint);
                            allpoints.Add(endPoint);
                        }
                        segment.UpdateSegment(allpoints, series);
                        segment.refresh = true;
                    }
                }
                else
                {                        
                    for (int i = 0, count = points.Length; i < count - 1; i++)
                    {
                        startPoint = points[i].DataPoint;
                        endPoint = points[i + 1].DataPoint;
                        GetBezierControlPoints(startPoint, endPoint, yCoef[i], yCoef[i + 1], out startControlPoint, out endControlPoint);
                        allpoints.Add(startPoint);
                        allpoints.Add(startControlPoint);
                        allpoints.Add(endControlPoint);
                        allpoints.Add(endPoint);
                    }
                    series.Segments.Add(new ChartFastSplineSegment(allpoints, points, series)); 
                }
            }
            else if (series.Segments.Count == 0 || series.internaldata_modified || allpoints.Count > points.Length)
            {
                allpoints = new List<IChartDataPoint>();
                series.Segments.Clear();
                series.Adornments.Clear();
                ChartIndexedDataPoint[] pts = points;
                List<ChartIndexedDataPoint> tempPointArray = new List<ChartIndexedDataPoint>();                    
                for (int i = 0; i < pts.Length-1; i++)
                {
                    switch (pts[i].DataPoint.EmptyPoint)
                    {
                        case false:
                            {
                                startPoint = points[i].DataPoint;
                                endPoint = points[i + 1].DataPoint;
                                GetBezierControlPoints(startPoint, endPoint, yCoef[i], yCoef[i + 1], out startControlPoint, out endControlPoint);
                                allpoints.Add(startPoint);
                                allpoints.Add(startControlPoint);
                                allpoints.Add(endControlPoint);
                                allpoints.Add(endPoint);
                                tempPointArray.Add(pts[i]);
                                break;
                            }
                        case true:
                            {
                                if (allpoints.Count > 0)
                                {
                                    if (i < points.Length)
                                    {
                                        startPoint = points[i].DataPoint;
                                        endPoint = points[i + 1].DataPoint;
                                        GetBezierControlPoints(startPoint, endPoint, yCoef[i], yCoef[i + 1], out startControlPoint, out endControlPoint);
                                        allpoints.Add(startPoint);
                                        allpoints.Add(startControlPoint);
                                        allpoints.Add(endControlPoint);
                                        allpoints.Add(endPoint);
                                    }
                                    tempPointArray.Add(points[i]);

                                }
                                break;
                            }
                    }
                }
                if (tempPointArray.Count != 0 && allpoints.Count != 0)
                {
                    series.Segments.Add(new ChartFastSplineSegment(allpoints, tempPointArray.ToArray(), series));
                }
            }
            if (series.Segments.Count > 0)
            {
                List<ChartIndexedDataPoint> tempPointArray = new List<ChartIndexedDataPoint>();
                List<ChartIndexedDataPoint> pts = points.ToList();

                if (!series.Contains_emptypt)
                {
                    int cnt = (allpoints.Count+4)/4;
                    while ((allpoints.Count + 4) / 4 != points.Length && (allpoints.Count + 4) / 4 < points.Length)
                    {
                        startPoint = points[cnt-1].DataPoint;
                        endPoint = points[cnt].DataPoint;
                        GetBezierControlPoints(startPoint, endPoint, yCoef[cnt-1], yCoef[cnt], out startControlPoint, out endControlPoint);
                        allpoints.Add(startPoint);
                        allpoints.Add(startControlPoint);
                        allpoints.Add(endControlPoint);
                        allpoints.Add(endPoint);
                        cnt++;
                    }
                }
                (series.Segments[0] as ChartFastSplineSegment).m_points = allpoints;
                if (series.ActualXAxis.IsAutoSetRange || series.Zoomactionenabled)
                {                        
                    double X_MAX = allpoints.Max(x => x.X);
                    double X_MIN = allpoints.Min(x => x.X);
                    (series.Segments[0] as ChartFastSplineSegment).xRange = new DoubleRange(X_MIN, X_MAX);//xRange + cdpt.X;
                    if (series.ActualXAxis.RangeCalculationMode == RangeCalculationMode.AdjustAcrossChartTypes)
                    {
                        (series.Segments[0] as ChartFastSplineSegment).xRange += (series.Segments[0] as ChartFastSplineSegment).xRange.Start - 0.5;
                        (series.Segments[0] as ChartFastSplineSegment).xRange += (series.Segments[0] as ChartFastSplineSegment).xRange.End + 0.5;
                    }
                    (series.Segments[0] as ChartFastSplineSegment).SetRange(series);

                }
                if (series.ActualYAxis.IsAutoSetRange || series.Zoomactionenabled)
                {                        
                    double Y_MAX = allpoints.Max(y => y.Y);
                    double Y_MIN = allpoints.Min(y => y.Y);

                    (series.Segments[0] as ChartFastSplineSegment).yRange = new DoubleRange(Y_MIN, Y_MAX);//yRange + cdpt.Y;

                    if (series.ActualXAxis.RangeCalculationMode == RangeCalculationMode.AdjustAcrossChartTypes)
                    {
                        (series.Segments[0] as ChartFastSplineSegment).xRange += (series.Segments[0] as ChartFastSplineSegment).xRange.Start - 0.5;
                        (series.Segments[0] as ChartFastSplineSegment).xRange += (series.Segments[0] as ChartFastSplineSegment).xRange.End + 0.5;
                    }

                    (series.Segments[0] as ChartFastSplineSegment).SetRange(series);
                    if (series.Zoomactionenabled)
                    {
                        series.Zoomactionenabled = false;
                    }
                }
            }
        }     
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:49:37+00:00Added an answer on June 15, 2026 at 6:49 am

    Can your application make use of data virtualization? http://www.codeproject.com/Articles/34405/WPF-Data-Virtualization

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to insert large amount of data into SqlServer 2008. My project is
I need to find a way to efficiently process a large amount of data
If you had a fairly large amount of data (say a million rows) that
I have a large amount of data to process with math intensive operations on
I need to process a large number of records (several million) representing people. I
I need to pull a large amount of data from various tables across a
I have a table with a large amount of data and need to do
I'm writing a c# app that inserts a large (1GB+) amount of data into
I am developing a C++ application that needs to process large amount of data.
I need to process a large number of files in a directory. The files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.