Area Graph

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
mikethelad
Newbie
Newbie
Posts: 58
Joined: Thu Jul 05, 2012 12:00 am

Area Graph

Post by mikethelad » Wed Jul 18, 2012 3:40 pm

Trying to achive a graph as per sample, I have tried an area graph, but I only have 1 value for each response, so all I get is all in the left hand column, I need to fill the area 100%, so was thinking the area graph is what is needed
Attachments
area.jpg
area.jpg (36.07 KiB) Viewed 5941 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Area Graph

Post by Sandra » Mon Jul 23, 2012 12:03 pm

Hello miethelad,

Sorry for the delay. I think should be useful for you, use a customBarSeries as do in the example of Demo All Features\Welcome !\Chart styles\Standard\Bar\Bar Size example. As you see in this example is used a custom series to change the size of Bars. I have made a simple project where try to achieve as you want using a CustomBarSize class and changing the size and positions of Bars.
GeneralTest.zip
(29.6 KiB) Downloaded 356 times
Can you tell us if previous code works as you expect?


I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

mikethelad
Newbie
Newbie
Posts: 58
Joined: Thu Jul 05, 2012 12:00 am

Re: Area Graph

Post by mikethelad » Tue Jul 24, 2012 10:03 am

Thanks, your demo worked fine apart from can't see how the invert works as this did not work, I have added my 3 of my values to the data, but is not right, see attached
Attachments
graph.JPG
graph.JPG (61.58 KiB) Viewed 5844 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Area Graph

Post by Sandra » Tue Jul 24, 2012 3:14 pm

Hello mikethelad,

I have made a simple code to adapt the bars at your values:

Code: Select all

        CustomBarSize bar1, bar2, bar3;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            bar1 = new CustomBarSize(tChart1.Chart);
            bar2 = new CustomBarSize(tChart1.Chart);
            bar3 = new CustomBarSize(tChart1.Chart);

            bar1.Add(1, 100, "16.3%", Color.Black);
            bar2.Add(2, 100, "60.3%", Color.Blue);
            bar3.Add(3, 100, "0.4%", Color.Red);

            bar1.SideMargins = false;
            bar2.SideMargins = false;
            bar3.SideMargins = false;
            bar1.SizeValues[0] = 1.63;
            bar2.SizeValues[0] = 6.3;
            bar3.SizeValues[0] = 0.04;
            bar1.XValues[0] = 0;
            bar2.XValues[0] = 2;
            bar3.XValues[0] = 5.1;
            tChart1.Axes.Bottom.Labels.Style = AxisLabelStyle.Value;
            tChart1.Axes.Bottom.SetMinMax(-2, 5.2);
            tChart1.Axes.Bottom.Increment = 1;
            tChart1.Axes.Bottom.MinimumOffset = 1;
            tChart1.Axes.Bottom.MaximumOffset = 1;
        }
Can you tell us if previous code help you to achieve as you want? As you see you need modify the Xvalue to adapt your data.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

mikethelad
Newbie
Newbie
Posts: 58
Joined: Thu Jul 05, 2012 12:00 am

Re: Area Graph

Post by mikethelad » Tue Jul 24, 2012 3:21 pm

I can see how the below are done, and can do formula:-

bar1.SizeValues[0] = 1.63;
bar2.SizeValues[0] = 6.3;
bar3.SizeValues[0] = 0.04;

The XValues I can't work out,

bar1.XValues[0] = 0;
bar2.XValues[0] = 2;
bar3.XValues[0] = 5.1;

The graphs will have vary number of columns, from 2 upto 9

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Area Graph

Post by Narcís » Thu Jul 26, 2012 9:28 am

Hi mikethelad,

You could do something as in the All Features\Welcome !\Chart styles\Standard\Area\Sales vs. Price example in the features demo where Area series is being used.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply