Line series visibility changes on re-sizing chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
chandran
Newbie
Newbie
Posts: 6
Joined: Fri Jan 31, 2014 12:00 am

Line series visibility changes on re-sizing chart

Post by chandran » Thu Nov 13, 2014 2:37 pm

2LastSeriesInvisible.png
Last series invisible on resizing chart
2LastSeriesInvisible.png (30.81 KiB) Viewed 6345 times
1AllSeriesVisible.png
default view without any problem
1AllSeriesVisible.png (22.51 KiB) Viewed 6334 times
SeriesVisibilityIssue.zip
Sample project exhibiting the issue
(11.52 KiB) Downloaded 646 times
Hi,

Here is one problem that we are facing with line series visibility while re-sizing chart horizontally.
We are using TeeChart for .NET version 4.1.2014.5092.

The chart which exhibits this behavior has multiple line series, each of which has been plotted using 2 points.
The y values for each of points in these line series range between 0 and 1.
The chart is rendered perfectly but when the window containing it is re-sized horizontally, one random series is set invisible.
Decrease/increase width by around 5-10% of original width, repeat this action for 2-3 times; one random series will get hidden.

Please find attached compressed folder containing sample project.
Extract the contents, open & run the solution; and follow above mentioned steps to get the problem reproduced.
Images are also attached for illustrating this issue.
Let me know if anything is not clearly stated.

Please suggest if there exists any solution to fix this issue.
Any help will be really appreciable.

Thanks,
Chandran

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

Re: Line series visibility changes on re-sizing chart

Post by Christopher » Thu Nov 13, 2014 4:17 pm

chandran wrote:Please suggest if there exists any solution to fix this issue.
Any help will be really appreciable.
Interesting problem, from a programmer's point of view, but apologies for this issue from a business-client point of view. I have found and resolved the issue, but unfortunately it requires a source-code change, and as such won't be available until the end of this month or the beginning of next month when the next maintenance release comes out.

For your interest, the issue is one of double precision and equivalence. Within the source code, a change has been made from:

Code: Select all

          if (firstVisible >= 0)
          {
            tmpMax = CalcMinMaxValue(r.Right, r.Bottom, r.Left, r.Top);

            if (notMandatory.Last <= tmpMax)
            {
              lastVisible = tmpLastIndex;
            }
to

Code: Select all

          if (firstVisible >= 0)
          {
            tmpMax = CalcMinMaxValue(r.Right, r.Bottom, r.Left, r.Top);

            if (!Utils.MinimalDifference(notMandatory.Last, tmpMax, 1) || notMandatory.Last <= tmpMax)
            {
              lastVisible = tmpLastIndex;
            }
where the MinimalDifference is a slight variation on this Microsoft-recommended method called HasMinimalDifference.
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

chandran
Newbie
Newbie
Posts: 6
Joined: Fri Jan 31, 2014 12:00 am

Re: Line series visibility changes on re-sizing chart

Post by chandran » Thu Jan 08, 2015 6:00 am

Thanks Christopher.

Post Reply