Memory Usage keep increasing when auto scrolling chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
jdsu
Newbie
Newbie
Posts: 22
Joined: Tue Jun 14, 2011 12:00 am

Re: Memory Usage keep increasing when auto scrolling chart

Post by jdsu » Mon Apr 16, 2012 6:55 am

Hi Sandra,

Using your code, which only uses e.LabelText, the memory does not increase in my test application.

However, I will need to try it out in our actual application which is more complex as it has both time and non-time series mixed in a single Chart. I'm not sure whether e.LabelText is sufficient.

I will revert if I have further problem.

Thanks for the help.

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

Re: Memory Usage keep increasing when auto scrolling chart

Post by Sandra » Mon Apr 16, 2012 12:31 pm

Hello jdsu,

Thanks for your information. If you have any problems please let me know :).

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

jdsu
Newbie
Newbie
Posts: 22
Joined: Tue Jun 14, 2011 12:00 am

Re: Memory Usage keep increasing when auto scrolling chart

Post by jdsu » Tue Apr 24, 2012 1:56 am

Hi Sandra,

With just the e.LabelText, it is very difficult to work with.
I have problem with the Labels shown in front of the 1st Data Point.

The first scenario is showing the Time Span. You can see that the Labels shows Negative Time Span.
This is not wanted. I only want the label to show from "00:00:00.0" on the first Data Point on wards.

The second scenario is showing the Physical Time. You can see that the Labels shows time before the 1st Data Point.
This is not wanted. I only want the label to show starting from the first Data Point.

How can I change the code to solve the above issues?
Attachments
time-before-first-point.png
time-before-first-point.png (10.87 KiB) Viewed 5920 times
negative.png
negative.png (12.23 KiB) Viewed 5946 times

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

Re: Memory Usage keep increasing when auto scrolling chart

Post by Sandra » Tue Apr 24, 2012 3:16 pm

Hello jdsu,

Can you please try to do something as next code in your application and check if it works as you expect?

Code: Select all

            if (sender == tChart1.Axes.Bottom)
            {
    
                    DateTime firstValue = DateTime.FromOADate(tChart1[0].XValues.First);
                    DateTime itemValue = DateTime.Parse(e.LabelText);
                    if (firstValue > itemValue)
                    {
                        e.LabelText = firstValue.Subtract(itemValue).ToString();
                    }
                    else
                    {
                        e.LabelText = itemValue.Subtract(firstValue).ToString();
}
               
If you have any problems, please let me know.

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

JDSU
Newbie
Newbie
Posts: 1
Joined: Tue Apr 24, 2012 12:00 am

Re: Memory Usage keep increasing when auto scrolling chart

Post by JDSU » Thu May 17, 2012 4:39 pm

Hi Sandra,

Referring to the chart in my previous email, notice that my first data point on the chart is not align with the grid lines.
How can I make the grid lines starts from my first data point?

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

Re: Memory Usage keep increasing when auto scrolling chart

Post by Sandra » Mon May 21, 2012 10:00 am

Hello JDSU,

I consider that in my suggestion project, first data point is aligned in the grid line, as you can see in my attached image:
FirstNumberAlign.jpg
FirstNumberAlign.jpg (146.62 KiB) Viewed 5828 times
As you see in the black rectangles I have drawn around of the grid line and first value of data, the align of point with grid, is correct for me. If you doesn't agree with me and consider that alienation should be the other, please, you can explain as you expect the first value is aligned

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