How to draw line and area types on a same chart ??

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ISP Co.Ltd.
Newbie
Newbie
Posts: 2
Joined: Thu Mar 02, 2023 12:00 am
Contact:

How to draw line and area types on a same chart ??

Post by ISP Co.Ltd. » Tue Jun 20, 2023 7:41 am

Greetings.

I want to draw a area + line type graph like the attached picture file.
I tried to draw line + area series, but i couldn't. Only line-type graphs were drawn on the chart.
I'd be grateful if you could tell me how.

many thanks.
Attachments
line_and_area.png
line_and_area.png (8.98 KiB) Viewed 9879 times
ISP

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: How to draw line and area types on a same chart ??

Post by Christopher » Tue Jun 20, 2023 3:51 pm

Hello,

for drawing the area under a curve, you can use the SeriesRegion tool like this:

Code: Select all

        public Form1()
        {
            InitializeComponent();

            var line = new Line(tChart1.Chart);
            line.FillSampleValues(1000);

            tChart1.Axes.Bottom.SetMinMax(600, 1000);

            _ = new SeriesRegionTool(tChart1.Chart)
            {
                AutoBound = false,
                LowerBound = 820,
                UpperBound = 870,
                Series = line,
                DrawBehindSeries = true,
                Color = System.Drawing.Color.AliceBlue,
            };

            _ = new SeriesRegionTool(tChart1.Chart)
            {
                AutoBound = false,
                LowerBound = 920,
                UpperBound = 970,
                Series = line,
                DrawBehindSeries = true,
                Color = System.Drawing.Color.PowderBlue,
            };
        }
Screenshot from 2023-06-20 17-49-45.png
Screenshot from 2023-06-20 17-49-45.png (32.69 KiB) Viewed 9861 times
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply