Change of behavior: axis offset

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
dimitrig
Newbie
Newbie
Posts: 17
Joined: Wed Jul 18, 2007 12:00 am
Location: Belgium
Contact:

Change of behavior: axis offset

Post by dimitrig » Mon Apr 26, 2010 3:30 pm

Hi,

I recently noticed that the MinimumOffset and MaximumOffset of an axis do not behave the same anymore. That is when using it in combination with a Volume series. I'm using the latest stable TeeChart v3 release btw.

Now when you have a Volume series on your chart, the offset of the axes do not work anymore. That is as long as Automatic (min and max) of the axis is on. From the moment you turn Automatic off, changing MinimumOffset and MaximumOffset works again. When you have the chart editor open btw, and you put Automatic on again, this automatically clears the offset fields (shouldn't be doing this). This is very weird, since with other series you don't have this (other Cartesian series styles that we use: fastline, line, point). I don't know whether other series types are impacted.

You can easily reproduce this just by creating a chart and a volume series. Then open the chart editor and try to adapt the offsets of the Bottom Axis, and you will see that it is broken. With other series you can change this on-the-fly, and you can immediately see the result. With a Volume, it is just not moving.


We use this offset to make sure the first vertical line and last of a volume series are always visible (typically they fall off unless you set this offset). This is something I reported years ago by the way, but which was never implemented (http://www.teechart.net/support/viewtopic.php?t=4872). We decided to use this offset, since there was not really a fix in sight. However, now because of this change, there is no way anymore to fix this, and we would like to see the behavior back as it has been before for years.

I don't know what has changed exactly. I tried to look with Reflector for a clue, but couldn't find one. Can you tell me whether this is gonna be fixed, or give me a solution to bring the "old" behavior back again.

regards,

dimitrig
Newbie
Newbie
Posts: 17
Joined: Wed Jul 18, 2007 12:00 am
Location: Belgium
Contact:

Re: Change of behavior: axis offset

Post by dimitrig » Mon Apr 26, 2010 3:47 pm

Btw... while playing along a little bit more (with Reflector), I found the culprit.

Volume inherits from CustomPoint. Apparently there you override the CalcHorizMargins(ref int, ref int, ref bool). The last parameter can force to reset the Minimum- and MaximumOffset of an axis. Something must has changed here in one of the more recent TeeChart version, which puts this Force parameter to true now.

I currently fixed it by making my own Volume series, just by inheriting from it with my custom class, and overriding this method again and going back to the default:

Code: Select all

        /// <summary>
        /// Calculate the horiz margins.
        /// </summary>
        /// <param name="LeftMargin"></param>
        /// <param name="RightMargin"></param>
        /// <param name="Force"></param>
        protected override void CalcHorizMargins(ref int LeftMargin, ref int RightMargin, ref bool Force)
        {
            this.CalcHorizMargins(ref LeftMargin, ref RightMargin);
            Force = false;
        }
Anyway. Just wanted to share this information.

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

Re: Change of behavior: axis offset

Post by Yeray » Tue Apr 27, 2010 2:15 pm

Hi dimitrig,

I'd like you to know that I've reproduced the problem in the latest v3, but also note that it works fine with the actual v2009.
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

Post Reply