Horizontal Line - Large Number of data points

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Nitin
Newbie
Newbie
Posts: 6
Joined: Fri Sep 05, 2008 12:00 am

Horizontal Line - Large Number of data points

Post by Nitin » Tue Nov 24, 2009 7:05 am

Hi,

We are using TeeChart for .NET Ver 3.5 in our application. We have the feature requirement which requires plotting of about 500000 data points in horizontal line. I have successfully tried this with FastLine series and it works. But it takes very long time plotting this much data points in horizontal line series.

My question is, can TeeChart horizontal line series handle half a million (or maybe more) data points effectively? Please guide me whether its possible with TeeChart or not.

Nitin

Yeray
Site Admin
Site Admin
Posts: 9601
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Horizontal Line - Large Number of data points

Post by Yeray » Wed Nov 25, 2009 3:27 pm

Hi Nitin,

Please take a look at the Real-time Charting article here where some tips for improving the performance are explained.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Nitin
Newbie
Newbie
Posts: 6
Joined: Fri Sep 05, 2008 12:00 am

Re: Horizontal Line - Large Number of data points

Post by Nitin » Thu Nov 26, 2009 4:57 am

Hi Yeray,

Thanks for the reply. I have already gone through the article and as I said, it works with FastLine series. But fast line series is vertical line series, where my requirement is to plot data in Horizontal Line Series. How can I speed up horizontal line series.

Yeray
Site Admin
Site Admin
Posts: 9601
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Horizontal Line - Large Number of data points

Post by Yeray » Fri Nov 27, 2009 4:39 pm

Hi Nitin,

Have you tried using a FastLine series to draw the Horizontal line? If yes, what problems did you found?
Please, take a look at the following example where the same line is drawn using an HorizLine and a FasLine:

Code: Select all

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }

        int nSamples;
        int[] XVal;
        int[] YVal;

        private void InitializeChart()
        {
            nSamples = 500000;
            XVal = new int[nSamples];
            YVal = new int[nSamples];
            Random rnd = new Random();

            XVal[0] = 0;
            YVal[0] = rnd.Next(100);            
            for (int i = 1; i < nSamples; i++)
			{
                XVal[i] = i;
                YVal[i] = YVal[i - 1] + rnd.Next(10) - 5;
			}

            CreateAndFillSeries();
        }

        private void CreateAndFillSeries()
        {            
            if (tChart1.Series.Count > 0)            
                if (tChart1[0] is Steema.TeeChart.Styles.FastLine) HorizLine();
                else FastLine();            
            else FastLine();            
        }

        private void FastLine()
        {
            tChart1.Clear();
            tChart1.Aspect.View3D = false;
            tChart1.Legend.Visible = false;
            tChart1.Header.Text = "FastLine";
            Steema.TeeChart.Styles.FastLine fastLine1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
            fastLine1.Add(YVal, XVal);
        }

        private void HorizLine()
        {
            tChart1.Clear();
            tChart1.Aspect.View3D = false;
            tChart1.Legend.Visible = false;
            tChart1.Header.Text = "HorizLine";
            Steema.TeeChart.Styles.HorizLine horizLine1 = new Steema.TeeChart.Styles.HorizLine(tChart1.Chart);
            horizLine1.Add(YVal, XVal);            
        }        

        private void button1_Click(object sender, EventArgs e)
        {
            CreateAndFillSeries();
        }
    }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Nitin
Newbie
Newbie
Posts: 6
Joined: Fri Sep 05, 2008 12:00 am

Re: Horizontal Line - Large Number of data points

Post by Nitin » Sat Nov 28, 2009 5:05 am

Hi Yeray,

Thanks for the code. I didn't know this thing. It works and takes only a second to plot the data.

Thank you very much.

Nitin

Yeray
Site Admin
Site Admin
Posts: 9601
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Horizontal Line - Large Number of data points

Post by Yeray » Mon Nov 30, 2009 11:23 am

Hi Nitin,

I'm pleased to have been helpful!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply