Page 1 of 1

TeeChart locks up when using LogarithmicBase

Posted: Fri Aug 12, 2011 1:33 pm
by 15659008
Hi,

I'm using TeeChar version 4.1.2011.7283 (latest version so far) with WPF and VS2010SP1. If I use a logarithmic scale on one of the axis in conjunction with a given LogarithmicBase, then TeeChart will lock up (100% CPU time) if I resize (making it larger) or maximize the dialog.
Even worse, if I comment out the line "mQtLine.Add(160.39, 0);" the program will not start at all. If I do not use the line "TcQx.Axes.Bottom.LogarithmicBase = 0.01;" everything seems to be normal.

Here's the code for a small test program (complete project can be provided on demand):

MainWindow.xaml.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TeeChartError
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
Steema.TeeChart.WPF.Styles.FastLine mQtLine;
public MainWindow()
{
InitializeComponent();
TcQx.Aspect.View3D = false;
TcQx.Legend.Visible = false;
TcQx.Header.Lines = new string[] { "q(x)-Diagram" };
TcQx.Axes.Bottom.Title.Lines = new string[] { "Particle size [µm]" };
TcQx.Axes.Left.Title.Lines = new string[] { "Distribution density (q3)" };
TcQx.Axes.Bottom.Logarithmic = true;
TcQx.Axes.Bottom.LogarithmicBase = 0.01;

mQtLine = new Steema.TeeChart.WPF.Styles.FastLine();
mQtLine.Add(0.67, 0.02);
mQtLine.Add(0.99, 0.06);
mQtLine.Add(1.2, 0.11);
mQtLine.Add(1.4, 0.16);
mQtLine.Add(160.39, 0);
TcQx.Series.Add(mQtLine);
}
}
}

MainWindow.xaml:

<Window x:Class="TeeChartError.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" xmlns:my="clr-namespace:Steema.TeeChart.WPF;assembly=TeeChart.WPF">
<Grid>
<my:TChart Name="TcQx" />
</Grid>
</Window>


Thanks for any help on this problem.

Re: TeeChart locks up when using LogarithmicBase

Posted: Tue Aug 16, 2011 10:56 am
by 10050769
Hello Sympatec,

Seems, this is a bug. I have added your problem in bug list report with number [TF02015699]. We will try to fix it in next maintenance releases of TeeChart.Net.

Thanks,

Re: TeeChart locks up when using LogarithmicBase

Posted: Tue Aug 16, 2011 11:55 am
by 15659008
Hi Sandra,

thanks for your reply.
When playing around with the sample above I've found another issue: If you're panning the graph to the zero direction (right click and move the mouse to the right), then the
grid is going crazy. This seems to be independent of the LogarithmicBase.

Bye,

Re: TeeChart locks up when using LogarithmicBase

Posted: Wed Aug 17, 2011 8:56 am
by 10050769
Hello Sympatec,

Thanks for information. This request is known for us and I recommend you take a look in this link where is explained because the problem occurs and suggest a solution for it.

Thanks,

Re: TeeChart locks up when using LogarithmicBase

Posted: Tue Aug 23, 2011 6:24 am
by 15659008
Hi again,

I read the suggested forum entry but the mathematical background and the proposed solution is wrong.
It is certainly possible to show x-values < 1 in a diagram with a logarithmic x-scale! That's the main
reason for using logarithmic scales: To show very small and very large values in one diagram. The only
value you can't show is zero!
In my opinion the panning of the diagram should stop automatically on the logarithmic base or if
there's no logarithmic base given on the smallest provided value.
One question: Is it possible to forbid panning of the diagram?

Re: TeeChart locks up when using LogarithmicBase

Posted: Wed Aug 24, 2011 8:59 am
by 10050769
Hello Sympatec,

We have done many test and we have found in this link that the base b must be a positive real number not equal to 1. So you set, for example:

Code: Select all

tChart1.Axes.Bottom.LogarithmicBase = -10;  
is not a mathematically valid operation and we consider bug with number (TF02015699) as not a bug.
In my opinion the panning of the diagram should stop automatically on the logarithmic base or if
there's no logarithmic base given on the smallest provided value.
One question: Is it possible to forbid panning of the diagram?
How I have told in previous post, it is known problem for us and we works to improve this behaviour. On the other hand, if you want disable panning you only have use next line of code:

Code: Select all

problemtChart1.Panning.Allow = Steema.TeeChart.ScrollModes.None;
Thanks,

Re: TeeChart locks up when using LogarithmicBase

Posted: Thu Aug 25, 2011 11:29 am
by 15659008
Hi,

I'm not talking about setting the Logarithmic base to 1 or negative values.
In the link you've provided there's the statement:
Given that Log(1) = 0, logarithmic axes can not plot values smaller than one and hence your values disappearing
.
And this statement is not true as you can certainly plot all values>0 in a logarithmic diagram.
In my former postings there was a misunderstanding of what the LogarithmicBase will do. I thought it defines the smallest possible x-value in the logarithmic diagram but it means
the base of the logarithmic calculation.
But if I pan the diagram towards zero then the grid will go crazy and this will happen regardless of the values or the LogarithmicBase in the diagram. Panning a logarithmic diagram means
a kind of zooming and this zooming should stop at a certain level (for example 10E-6 in the zero-direction and 10E6 in the other direction).

Thanks for your attention and bye,

Re: TeeChart locks up when using LogarithmicBase

Posted: Fri Aug 26, 2011 8:13 am
by 10050769
Hello Sympatec,

Ok. Thanks for your information and we will consider to improve behavior of axes scale when treat Logarithmic values.

Thank you,