Can I restrict the height of ColorBand?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
AndrewP
Newbie
Newbie
Posts: 20
Joined: Tue May 12, 2009 12:00 am

Can I restrict the height of ColorBand?

Post by AndrewP » Thu Jul 30, 2009 2:50 pm

What I want is the ability to display ColorBands, but only for a certain percentage of the axis they are attached to. That way, they will remain stationary on the chart even if the axis range changes. I have investigated drawing rectangles with Graphic3D and would rather not have to go that way. Does anyone have any suggestions? Is there another tool that might be able to do this? Is this type of functionality other are interested in and therefore might be worth adding to the product?

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

Re: Can I restrict the height of ColorBand?

Post by Narcís » Thu Jul 30, 2009 3:07 pm

Hi AndrewP,
What I want is the ability to display ColorBands, but only for a certain percentage of the axis they are attached to.
I think I understand this point. It's not possible using ColorBand. You may want to use Shape series with Style set to rectangle or also RectangleTool.
That way, they will remain stationary on the chart even if the axis range changes.
I don't understand this. Could you please elaborate on that so that we can suggest most suitable solution? Feel free to attach an image if you think it would make the explanation easier or clearer.

Thanks in advance.
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

AndrewP
Newbie
Newbie
Posts: 20
Joined: Tue May 12, 2009 12:00 am

Re: Can I restrict the height of ColorBand?

Post by AndrewP » Thu Jul 30, 2009 3:40 pm

What I want to see is colored bands that only display in the bottom 10% of a given axis. Now if the axis changes (the range increases or decreases) the Colorbands should remain at 10%.

Can I restrict the ColorBand tool to display only within 1 X Axis AND 1 Y Axis?

AndrewP
Newbie
Newbie
Posts: 20
Joined: Tue May 12, 2009 12:00 am

Re: Can I restrict the height of ColorBand?

Post by AndrewP » Thu Jul 30, 2009 3:47 pm

I just uploaded an image. What you see if 2 series each on a different Y axis and on the same X axis. The ColorBands (Grenn and Black) are attached to the X axis and appears accross both Y axis. What I want to do is:
- Primary - restrict the ColorBands to one Y axis...
- Secondary - restrict the ColorBands to a part of one Y axis (say the bottom 10% of the Y axis).

What is the best way for me to accomplish this?

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

Re: Can I restrict the height of ColorBand?

Post by Sandra » Fri Jul 31, 2009 9:38 am

Hello AndrewP,
What I want to see is colored bands that only display in the bottom 10% of a given axis. Now if the axis changes (the range increases or decreases) the Colorbands should remain at 10%.

Can I restrict the ColorBand tool to display only within 1 X Axis AND 1 Y Axis?
You couldn't restrict the ColorBand if you have only one Chart, because colorBand is associated with Bottom Axes and only there are one Bottom Axes.
I just uploaded an image. What you see if 2 series each on a different Y axis and on the same X axis. The ColorBands (Grenn and Black) are attached to the X axis and appears accross both Y axis. What I want to do is:
- Primary - restrict the ColorBands to one Y axis...
- Secondary - restrict the ColorBands to a part of one Y axis (say the bottom 10% of the Y axis).

What is the best way for me to accomplish this?
I made a simple code, using a shape series as ColorBand. You could do a similar code as next, please check that next code works correctly in your application.

Code: Select all

        Steema.TeeChart.Styles.Shape shape;
        Steema.TeeChart.Styles.Line line1, line2;
        double x0, x1, y0, y1;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;

            shape = new Steema.TeeChart.Styles.Shape(tChart1.Chart);
            line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line1.Color = Color.Yellow;
            line2.Color = Color.Blue;

            line1.Pointer.Visible = true;
            line1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Triangle;
           
            line1.Pointer.InflateMargins = false;
            line1.FillSampleValues();
            line2.FillSampleValues();
            //You need paint series after calculate values of shape.
            tChart1.Draw();
            //Shape series 
            shape.Style = Steema.TeeChart.Styles.ShapeStyles.Rectangle;
            shape.Pen.Visible = false;
            shape.ShowInLegend = false;
            x0 = tChart1.Axes.Bottom.Minimum;
            x1 = tChart1.Axes.Bottom.Maximum / 12;
            y0 = tChart1.Axes.Left.Minimum;
            y1 = tChart1.Axes.Left.Maximum / 6;

            shape.X0 = x0;
            shape.Y0 = y0;
            shape.X1 = x1;
            shape.Y1 = y1;
        }
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

Post Reply