Line plotting issue

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Siva
Newbie
Newbie
Posts: 10
Joined: Thu Oct 20, 2016 12:00 am

Line plotting issue

Post by Siva » Thu Apr 20, 2017 12:41 pm

Hi,

We are using WPF Steema tee chart(TeeChart for .NET v2012 - 4.1.2012.01310) control for trending the values
While Loading, we add data values for every one second and every second we update the plotting by adding one more data point. Values added to the plot are toggled between two values every second.
With this setting we are observing an issue; where at the extreme left end of the tee chart the plotting is not correct (refer the attached screen shot).

One more observation is currently we are using Line control for plotting the values. If we replace Line control with FastLine the above mentioned issue is not happening.
In our project we are using the Line control. It's difficult to change this to FastLine as we will not be sure of whether it affects our existing features. We want to continue using Line control.

(Use the attached sample for reference to see the issue).
Can you please check and tell us the cause for this issue and how to resolve it?

Regards
Siva
Attachments
Attachments.zip
Souece Code and images of the issue
(104.33 KiB) Downloaded 841 times

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

Re: Line plotting issue

Post by Christopher » Thu Apr 20, 2017 2:15 pm

Hello Siva,

Between MainWindow.xaml.cs and WindowScroll.xaml.cs there are 1,609 lines of code - do you think it would be possible to reduce the size of your project so I can identify the problem more easily? On this webpage entitled "How to create a Minimal, Complete, and Verifiable example" there are some pointers on how to create the kind of example I am looking for.
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

Siva
Newbie
Newbie
Posts: 10
Joined: Thu Oct 20, 2016 12:00 am

Re: Line plotting issue

Post by Siva » Fri Apr 21, 2017 9:59 am

Hi Christopher,

Initially we were not able to reproduce the issue with simple sample application with tee-chart.
Then we tried to reproduce the issue with actual way followed in the product(loading history data with live data[by having the timer logic]).

After a long investigations, we found the issue is with Line, instead of FastLine. We don't have a time now to modify the sample code as you expected.
Please ignore "MainWindow.xaml.cs" as it is duplicate window and not required to analyse.

Please confirm that, is this an issue from tee-chart?
As the issue is easily observed and the sample applcaition also shared, hope you can proceed to analyse and help us to fix as soon as possible.
Please modify the sample application as required to resolve/fix this issue.

Waiting for your positive reply.

Regards
Siva

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

Re: Line plotting issue

Post by Christopher » Fri Apr 21, 2017 1:09 pm

Siva,

WindowScroll.xaml.cs is still 856 lines of code.

My problem is that my objective here is to resolve issues with TeeChart - I understand that your project demonstrates that there is a problem which affects TeeChart rendering, but gives me no irrefutable evidence of a problem in the TeeChart source code itself. I hope you can see my position.

Is there no way you can build something more resembling an MCVE please?
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

Siva
Newbie
Newbie
Posts: 10
Joined: Thu Oct 20, 2016 12:00 am

Re: Line plotting issue

Post by Siva » Mon Apr 24, 2017 3:32 pm

Hey Chris,

I have modified the code by removing unnecessary code. Can you please check and update now?

Regards,
Siva
Attachments
WpfScroll.zip
Modified sample
(24.9 KiB) Downloaded 796 times

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

Re: Line plotting issue

Post by Christopher » Tue Apr 25, 2017 2:44 pm

Thank you Siva.

I have now been able to reproduce the problem in a very reduced format:

Code: Select all

    private void InitializeChart()
    {
      Line line = new Line(tChart1.Chart);
      line.LinePen.Width = 3;

      int count = 10000;
      double diff = 10.0 / (double)count;
      int y = 10;

      for (int i = 0; i < count; i++)
      {
        line.Add(10 + (i * diff), y);
        if (y == 10) y = 20;
        else y = 10;
      }

      tChart1.Axes.Left.SetMinMax(0, 30);
      tChart1.Axes.Bottom.SetMinMax(15, 20);
      tChart1.Axes.Left.Visible = false;
    }
I have entered this issue to our bug-tracking software with id=1849 and have already fixed it - this fix will be in the next maintenance release. If you have the source-code version I can give the fix to you now.
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

Siva
Newbie
Newbie
Posts: 10
Joined: Thu Oct 20, 2016 12:00 am

Re: Line plotting issue

Post by Siva » Wed Apr 26, 2017 5:23 am

Hey Chris,

I'm glad you were able to find and fix the issue.
We do have source code with us. Please share the modifications to be done.

Regards,
Siva

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

Re: Line plotting issue

Post by Christopher » Wed Apr 26, 2017 7:42 am

Hello Siva,

Great - in which case the change is a one-liner in Custom.cs:
CustomCS.PNG
CustomCS.PNG (66.76 KiB) Viewed 23283 times
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

Siva
Newbie
Newbie
Posts: 10
Joined: Thu Oct 20, 2016 12:00 am

Re: Line plotting issue

Post by Siva » Thu May 04, 2017 10:44 am

Hi Chris,

I made the changes specified and it does not solve the problem. Use the attached modified sample.
While loading I'm adding points between 20 and 50. After this I'm adding one more point between 20 and 80 every second. Now again there is a line at extreme left where the line touches 80 even though I didn't add a point with that value.

Due to this even when the points density is less plot is not shown correctly (instead of 1 second use 30 seconds).

Regards,
Siva
Attachments
WpfScroll.zip
(24.94 KiB) Downloaded 845 times

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

Re: Line plotting issue

Post by Christopher » Thu May 04, 2017 5:10 pm

Hello Siva,

I'm afraid I'm having difficulties reproducing this issue here using an MCVE as I did last time. What I have at the moment is this:

Code: Select all

    Line line;
    bool flag = true;
    int y = 10;
    Random rnd = new Random();
    double diff;
    DispatcherTimer timer1;
    int count = 10000;

    private void InitializeChart()
    {
      line = new Line(tChart1.Chart);
      line.LinePen.Width = 3;

      diff = 10.0 / (double)count;

      for (int i = 0; i < count; i++) AddValue(i, Colors.Blue);

      tChart1.Axes.Left.SetMinMax(0, 50);
      tChart1.Axes.Bottom.SetMinMax(count / 2, count * 1.1);
      tChart1.Axes.Left.Visible = true;

      timer1 = new DispatcherTimer();
      timer1.Tick += timer1_Tick;
      timer1.Interval = new TimeSpan(0, 0, 0, 0, 100);
      timer1.Start();
    }

    private void AddValue(int i, Color color)
    {
      int limit = (count * 7) / 10;
      line.Add(i, y, color);
      if (flag) y = i < limit ? rnd.Next(10, 20) : rnd.Next(20, 40);
      else y = 10;
      flag = !flag;
    }

    private void timer1_Tick(object sender, EventArgs e)
    {
      AddValue(line.Count, Colors.Red);
      tChart1.Axes.Bottom.SetMinMax(line.Count / 2, line.Count * 1.1);
    }
By changing the value of count we can change the density of data - at any given density I can't see any extraneous points on the left axis as I did last time. Can you? Could you please retouch this code example to reproduce the issue using the minimal possible code?
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

Siva
Newbie
Newbie
Posts: 10
Joined: Thu Oct 20, 2016 12:00 am

Re: Line plotting issue

Post by Siva » Fri May 05, 2017 6:00 am

Hey Chris,

I removed all unnecessary things in my sample and kept only minimum possible code required to reproduce the issue. please check and let me know.

Regards,
Siva
Attachments
WpfScroll.zip
(23.34 KiB) Downloaded 837 times

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

Re: Line plotting issue

Post by Christopher » Fri May 05, 2017 8:02 am

Hi Siva,

That's great, thank you, just the sort of code snippet I was looking for.

The problem is that I still cannot see the issue! Please find following a 45-second screenvideo:
https://www.screencast.com/t/TsphP7122

I can't see any extraneous points being painting near the left axis - can you see them with this code snippet?
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

Siva
Newbie
Newbie
Posts: 10
Joined: Thu Oct 20, 2016 12:00 am

Re: Line plotting issue

Post by Siva » Mon May 08, 2017 5:14 am

Hi,

I'm able to reproduce the issue always. I think the difference is the dll version (I'm not sure which version you are using). I'm using TeeChart for .NET v2012 - 4.1.2012.1311. Can you use this version (plus your changes) and check for issue (for your reference I have attached the dll I have built here locally to reproduce the issue)?

Regards,
Siva

Siva
Newbie
Newbie
Posts: 10
Joined: Thu Oct 20, 2016 12:00 am

Re: Line plotting issue

Post by Siva » Tue May 09, 2017 11:53 am

Hey Chris,

Just checking whether you are able to reproduce the issue or you need any other information from our side?
Reply as soon as possible.

Regards,
Siva

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

Re: Line plotting issue

Post by Christopher » Wed May 10, 2017 9:14 am

Hello Siva,

Sorry for not get back to you immediately, but I think there is a problem. The issue is one of support and of support for source-code versions, specifically support of source-code versions that are not the latest public-release version, as is your case. In theory I should not help clients with any TeeChart source-code modifications here on support, but of course for bugs that I have fixed and which will appear in the upcoming public-release version I have no problem passing them on. In this particular case, however, the fix which resolves the issue in the source-code version of the latest public-release version does not resolve the issue in your older version of the source-code. To resolve the issue in your older version of the source-code I would have to spend the time identifying the change that has occurred between this version and the latest version and pass that change onto you as well. I'm afraid that I am not going to be able to do that for you.

What I will do is check with my colleagues that, in fact, I am not authorized to spend the necessary time on this issue and will get back to you as soon as possible.
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

Post Reply