colorband start and end lines

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

colorband start and end lines

Post by noaksey » Tue Mar 03, 2009 11:06 am

Is it possible to change the width of the colourlines used for drawing the start and end of the colourbands??

I'm in to a situation in that if the user zooms in a lot and makes a colourband too small, then on zoom out it doesn't appear as it is too thin, so I was going to see if the thickness of the lines could be changed - i'm not sure what else could be done!

Regards,
Chris

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

Post by Yeray » Tue Mar 03, 2009 1:46 pm

Hi Chris,

You could calculate the minimum difference between values that make them visible doing this after a first draw:

Code: Select all

OnePixelIncrement = tChart1.Axes.Left.CalcPosPoint(0) - tChart1.Axes.Left.CalcPosPoint(1);
And then force the values of your colorband to have this minimum visible distance at OnUndoZoom event.

Code: Select all

void tChart1_UndoneZoom(object sender, EventArgs e)
        {
            if (Math.Abs(colorband1.Start - colorband1.End) < Math.Abs(OnePixelIncrement))
            {
                colorband1.End = colorband1.Start + 2*OnePixelIncrement;
            }
        }
As you can see here you should add some code to save the old end colorband value and restore it at OnZoom event.

Another possibility could be drawing a line directly to the canvas using OnAfterDraw event.

I hope these ideas will help you.
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

noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

Post by noaksey » Tue Mar 03, 2009 2:47 pm

Thanks Yeray, i'll have a look at using them.

Post Reply