Page 1 of 1

Fill Peaks of sine wave

Posted: Thu Sep 24, 2009 3:24 am
by 13051032
I have an array of fastline series which display some sine waves. I like to know how i can optionally (user triggered) fill the peaks and through of the fastline series's sine wave.

Any help in this regard is greatly appreciated.

Re: Fill Peaks of sine wave

Posted: Thu Sep 24, 2009 11:53 am
by yeray
Hi asupriya,

I'm not sure to understand what are you exactly trying to draw here. Maybe a picture would help us to understand it better.

Anyway, have you seen the SeriesBand Tool and the SeriesRegion Tool?
- SeriesBandTool (All Features\Welcome !\Tools\SeriesBand Tool). Giving a line series to it, the are under the line until zero, will be painted.
- SeriesRegionTool (All Features\Welcome !\Tools\Area under the curve). With this, you'll be able to paint the area under a line but here you'll be able to set an XValue to start painting (the peak begin), an XValue to end painting (the peak finish) and an YValue (origin) to limit the drawing area under the line.

Re: Fill Peaks of sine wave

Posted: Thu Sep 24, 2009 12:34 pm
by 13051032
I am looking for something of effect shown in the image attached.

Thanks.
test.JPG
test.JPG (25.06 KiB) Viewed 2527 times

Re: Fill Peaks of sine wave

Posted: Thu Sep 24, 2009 2:57 pm
by yeray
Hi asupriya,

If you have those sin waves horizontal, you'll be able to use SeriesRegionTool. Note that you should create a SeriesRegionTool for each zone to mark.

And note that I've added the possibility to use this tool with Horizontal Line series in the wish list to be implemented in a further release (TF02014442).

Re: Fill Peaks of sine wave

Posted: Sat Sep 26, 2009 2:30 am
by 13051032
SeriesBandTool, SeriesRegionTool are not the ones i am looking for. Is there anything that can draw as shown in the attached image?

Thanks
untitled.JPG
untitled.JPG (8.51 KiB) Viewed 2524 times

Re: Fill Peaks of sine wave

Posted: Mon Sep 28, 2009 12:12 pm
by yeray
Hi asupriya,

You can use SeriesRegionTool to obtain a chart like in your picture with the following code:

Code: Select all

tChart1.Aspect.View3D = false;

            int nSeries = 4;

            int [] YPos = new int[nSeries];
            Steema.TeeChart.Styles.FastLine[] fast = new Steema.TeeChart.Styles.FastLine[nSeries];
            Steema.TeeChart.Tools.SeriesRegionTool[] region = new Steema.TeeChart.Tools.SeriesRegionTool[nSeries];

            for (int i = 0; i < nSeries; i++)
            {
                YPos[i] = i * 5;
                fast[i] = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
                if (i % 2 == 0)
                {
                    for (int j = 0; j < 200; j++) fast[i].Add(Math.Sin((double)j / 10) + YPos[i]);
                }
                else
                {
                    for (int j = 0; j < 200; j++) fast[i].Add(Math.Cos((double)j / 10) + YPos[i]);
                }

                region[i] = new Steema.TeeChart.Tools.SeriesRegionTool(tChart1.Chart);
                region[i].Series = fast[i];
                region[i].Origin = YPos[i];
                region[i].UseOrigin = true;
                region[i].Brush.Style = System.Drawing.Drawing2D.HatchStyle.Vertical;
                region[i].Brush.Transparency = 100;
                region[i].Pen.Visible = false;
                region[i].Brush.ForegroundColor = fast[i].Color;
            }

Re: Fill Peaks of sine wave

Posted: Mon Sep 28, 2009 6:41 pm
by 13051032
Great. Thanks alot. This is exactly what I needed.

Appreciate your help.