Bug in Axis.CalcPosPoint (log scales)

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Uli
Newbie
Newbie
Posts: 80
Joined: Thu Apr 22, 2010 12:00 am

Bug in Axis.CalcPosPoint (log scales)

Post by Uli » Tue Jul 06, 2010 9:35 am

Hi,

I must inform that the mentioned method calculates wrong values for logarithmic axes. My implementation is:

Code: Select all

   Private Sub Chart1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Chart1.MouseMove
        Dim X, Y, X2, Y2 As Double

        Try
            If CursorTool1 IsNot Nothing Then
                X = CursorTool1.XValue
            Else
                X = Chart1.Axes.Bottom.CalcPosPoint(e.X)
            End If
            Y = Chart1.Axes.Left.CalcPosPoint(e.Y)
            X2 = Chart1.Axes.Top.CalcPosPoint(e.X)
            Y2 = Chart1.Axes.Right.CalcPosPoint(e.Y)

            Dim XX = X.ToString("G5")
            Dim YY = Y.ToString("G5")
            Dim XX2 = X2.ToString("G5")
            Dim YY2 = Y2.ToString("G5")
            MyMainForm1.StatusStrip.Items(0).Text = " X = " + XX
            MyMainForm1.StatusStrip.Items(1).Text = " Y = " + YY
            MyMainForm1.StatusStrip.Items(2).Text = " X2 = " + XX2
            MyMainForm1.StatusStrip.Items(3).Text = " Y2 = " + YY2
        Catch
            Dim i As Integer = 0
            For i = 0 To 3
                MyMainForm1.StatusStrip.Items(i).Text = " -"
            Next

        End Try
    End Sub
For instance, having the mouse over X = 0.005 the displayed value is "0.00014".

Regards,

Uli

Uli
Newbie
Newbie
Posts: 80
Joined: Thu Apr 22, 2010 12:00 am

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Uli » Tue Jul 06, 2010 12:31 pm

Hi,

I just realized that the bug is much more engraving: The axis scaling is wrong, the CalcPosPoint method seems to be OK.

So the Logarithmic Scale Bug http://www.teechart.net/support/viewtop ... =4&t=11100 is also present in WinForms, not only in WPF.

The workaround in the above link works BUT:
- it's impossible to get appropriate axis labels (the series x values are between 0* and 0.023)
- it's impossible to convert to linear scale back
- after serialization/deserialization the error is there again
*x-axis minimum is at around 3e-5

This big bug makes it practically impossible for me to use TeeChart, logarithmic scales (and their conversion log <----> lin) are a must for me. My feeling is that axis scaling is such a basic feature of a chart component that it maust work under all circumstances!

Additionally, due to the other bugs discovered during the work on my application I wasted such an amount of time! Up to now, I used 3 sequenced releases of TeeChart, no one was bug free. Each of the two newer releases introduced new bugs concerning properties/features which I expected as basic for my application. They required a lot of work and time for workarounds which led to loss of functionality I primary introduced. And I have to ask me and you: When will the next release come? And will it again introduce new bugs questioning the usability of the charts?

It's extremely disappointing!

Uli

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Narcís » Tue Jul 06, 2010 3:08 pm

Hi Uli,

Can you please attach a simple example project with complete code to reproduce the issue here?
Additionally, due to the other bugs discovered during the work on my application I wasted such an amount of time! Up to now, I used 3 sequenced releases of TeeChart, no one was bug free.
I'm not trying to justify anything and I think such issues should be resolved. However, I'm afraid there's not a 100% bug free piece of software.
And I have to ask me and you: When will the next release come? And will it again introduce new bugs questioning the usability of the charts?
Bugs are not intentionally introduced. With each release more bugs should be fixed and code more stable. However, sometimes fixing an issue involves breaking other. If this occurs it's not intentionally. A date for the next maintenance release is not fixed yet. I guess it will probably be in August.

Thanks in advance.
Best Regards,
Narcís Calvet / 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

Uli
Newbie
Newbie
Posts: 80
Joined: Thu Apr 22, 2010 12:00 am

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Uli » Wed Jul 07, 2010 6:55 am

Hi Narcis,

I can provide a sample file test2.zip. The included test2.fxy is native *.ten. The file was created applying the workaround described in the link of my first message. After reloading it the logarithmic x axis is again wrong.

I bought TeeChart as a substitution of my own (coded with Delphi) chart component in order to concentrate my efforts onto extended data analysis. Key features of this component were sub/superscript in axis title, labels, legend and textfields (annotations). Without axis labels these features are not available in TeeChart. The rich text drawings in your sample applications were not serialized and therefore not really helpful. I realized the missing things in the after draw event. With the last TeeChart for VS 2010 release the legend behavior changed (you may visit my related posting http://www.teechart.net/support/viewtop ... =4&t=11247). With the workaround I can realize rich text in the legend again but I lost nearly all possibilities of legend formating (since correct witdth and height values were not more calculated internally). This is accompanied by a remarkable loss in performance. In the first release for VS 2010 line series were not displayed correctly in legend, see here http://www.teechart.net/support/viewtop ... =4&t=11091. This is another basic issue!

Essentially, of course, is the correct presentation of data, independent of the scale (normal, log, reversed). With this logarithmic scale bug this is not possible.
Additionally, due to the other bugs discovered during the work on my application I wasted such an amount of time! Up to now, I used 3 sequenced releases of TeeChart, no one was bug free.
I'm not trying to justify anything and I think such issues should be resolved. However, I'm afraid there's not a 100% bug free piece of software.
OK, I could - though frustrated - live with a bug where an asterix will be drawn instead of a square or legend format is not really sufficient. But I can not accept a chart component which draws the points at wrong positions or displays wrong axis scales. Such things are essential, with such bugs I can not use the chart. This basic functionality must be guaranteed!
Bugs are not intentionally introduced. With each release more bugs should be fixed and code more stable. However, sometimes fixing an issue involves breaking other. If this occurs it's not intentionally. A date for the next maintenance release is not fixed yet. I guess it will probably be in August.
I never thought that Steema introduces bugs intentionally. But, when such basic things do not wotk, it seems to me that that your testing is not appropriate. And I feel such basic functionality has to be fixed immediately. For about 3 or 4 weeks the data treatment and analysis methods of my application are ready to start real work. But it's impossible with the presently available TeeChart release! And you now say "propably in August" a new maintenance release will come. That's 4 to 8 weeks mor were I can not work... And:
sometimes fixing an issue involves breaking other
So, possibly I then still can not start to work due to another broking feature?

So it is a real question for me: Shall I go back to my own chart or look for a third alternative?

Best regards

Uli
Attachments
test2.zip
(2.81 KiB) Downloaded 1153 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Narcís » Wed Jul 07, 2010 2:57 pm

Hi Uli,

First of all please notice that we are doing our best to fix as many issue as possible and not breaking functionality with those fixes, giving higher priority to those issue we think affect a higher number of users or basic TeeChart functionality.
- it's impossible to get appropriate axis labels (the series x values are between 0* and 0.023)
Loading your template file and implementing MouseMove event as you mentioned in this thread, applying the workaorund Yeray suggested and positioning the mouse on the bottom-right corner of the chart I get this:
UliLogChart.jpg
UliLogChart.jpg (106.61 KiB) Viewed 26520 times
Is this the same you get? Can you please elaborate on which is the exact problem do you have with this?

For completeness, the code I'm using is this:

Code: Select all

    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }

    private Steema.TeeChart.Tools.CursorTool CursorTool1;

    private void InitializeChart()
    {
      tChart1.Dock = DockStyle.Fill;

      tChart1.Import.Template.Load(@"test2.fxy");
      tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);

      foreach (Steema.TeeChart.Tools.Tool t in tChart1.Tools)
      {
        if (t is Steema.TeeChart.Tools.CursorTool)
        {
          CursorTool1 = (Steema.TeeChart.Tools.CursorTool)t;
        }
      }

      //Workaround suggested at http://www.teechart.net/support/viewtopic.php?f=4&t=11100#p47787
      tChart1.Axes.Left.Logarithmic = true;
      tChart1.Axes.Left.Horizontal = tChart1.Axes.Left.Horizontal;
    }

    void tChart1_MouseMove(object sender, MouseEventArgs e)
    {
      double X = 0;
      double Y = 0;
      double X2 = 0;
      double Y2 = 0;

      try
      {
        if (CursorTool1 != null)
        {
          X = CursorTool1.XValue;
        }
        else
        {
          X = tChart1.Axes.Bottom.CalcPosPoint(e.X);
        }
        Y = tChart1.Axes.Left.CalcPosPoint(e.Y);
        X2 = tChart1.Axes.Top.CalcPosPoint(e.X);
        Y2 = tChart1.Axes.Right.CalcPosPoint(e.Y);

        object XX = X.ToString("G5");
        object YY = Y.ToString("G5");
        object XX2 = X2.ToString("G5");
        object YY2 = Y2.ToString("G5");
        this.statusStrip1.Items[0].Text = " X = " + XX;
        this.statusStrip1.Items[1].Text = " Y = " + YY;
        this.statusStrip1.Items[2].Text = " X2 = " + XX2;
        this.statusStrip1.Items[3].Text = " Y2 = " + YY2;
      }
      catch
      {
        int i = 0;
        for (i = 0; i < statusStrip1.Items.Count; i++)
        {
          this.statusStrip1.Items[i].Text = " -";
        }
      }

    }
- it's impossible to convert to linear scale back
I'm sorry but I'm not sure about what do you exactly mean here. Can you please give us some more information?
*x-axis minimum is at around 3e-5
When using logarithmic scale you don't get 0 as log(0) is undefined because no power can give a result of zero.

Thanks in advance.

Thanks in advance.
Best Regards,
Narcís Calvet / 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

Uli
Newbie
Newbie
Posts: 80
Joined: Thu Apr 22, 2010 12:00 am

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Uli » Wed Jul 07, 2010 3:33 pm

Hi Narcis,
Is this the same you get? Can you please elaborate on which is the exact problem do you have with this?
Yes, it is (I use linear y axis, but that's not important here).
Please look at the chart and you will see that x-Axis labels are not appropriate, they overlap.

I expect an appearance as shown here:
test2.jpg
test2.jpg (49.51 KiB) Viewed 26517 times
- it's impossible to convert to linear scale back
I'm sorry but I'm not sure about what do you exactly mean here. Can you please give us some more information?
If you have the chart as shown in your last message then you could open the chart editor and convert the x axis back to linear scale: Nothing happens!

*x-axis minimum is at around 3e-5
When using logarithmic scale you don't get 0 as log(0) is undefined because no power can give a result of zero.
Of course, I just wanted to illustrate that I did not try to set axis minimum to zero!


Regards,

Uli

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Narcís » Thu Jul 08, 2010 8:18 am

Hi Uli,
Please look at the chart and you will see that x-Axis labels are not appropriate, they overlap.
This can be solved changing the bottom axis increment after loading the template file like this:

Code: Select all

      tChart1.Axes.Bottom.Increment = 0.01;
If this is not what you expect please attach a simple example project recreating a similar chart so that we can see how the chart is created and we can review full code and chart settings.
If you have the chart as shown in your last message then you could open the chart editor and convert the x axis back to linear scale: Nothing happens!
This works fine for me here as you can see in the image below. Setting a single axis to non-logarithmic also works fine for me here.
UliNonLog.png
UliNonLog.png (22.31 KiB) Viewed 26504 times
Is that what you expect?

Thanks in advance.
Best Regards,
Narcís Calvet / 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

Uli
Newbie
Newbie
Posts: 80
Joined: Thu Apr 22, 2010 12:00 am

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Uli » Thu Jul 08, 2010 9:24 am

Hi Narcis,

here is the code (Project contains only button, tchart and chart controller). Within this small sample the chart behaves different in comparison to my application but toggling between log and linear scale is still impossible.

Code: Select all

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'TChart1.Import.Template.Load("c:\test2.fxy")
        TChart1.Series.Clear()
        TChart1.Aspect.View3D = False
        '//Workaround suggested at http://www.teechart.net/support/viewtopic.php?f=4&t=11100#p47787
        TChart1.Axes.Bottom.Logarithmic = True
        TChart1.Axes.Bottom.Horizontal = TChart1.Axes.Bottom.Horizontal
        Dim Point As New Steema.TeeChart.Styles.Points(TChart1.Chart)
        For i As Integer = 2 To 5
            Point.Add(Math.Pow(10, -i), i)
        Next
    End Sub
Here you can see the images when toggling the logarithmic property:
test2_a.JPG
test2_a.JPG (67.04 KiB) Viewed 26494 times
test2_b.JPG
test2_b.JPG (65.63 KiB) Viewed 26498 times
It should be very clear that the points must not be at the same positions!

Axis labeling seems to be also dependent from other things. In your mail from 07 Jul 2010 14:57 you got another labeling then I got with this example (x value range is comparable).

Best regards

Uli

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Narcís » Thu Jul 08, 2010 9:42 am

Hi Uli,
It should be very clear that the points must not be at the same positions!
This works fine for me here using the sources with the fix for TF02014882 as can be seen here:
UliBottomNonLog.png
UliBottomNonLog.png (8.38 KiB) Viewed 26494 times
This fix will be included in next maintenance release.
Axis labeling seems to be also dependent from other things. In your mail from 07 Jul 2010 14:57 you got another labeling then I got with this example (x value range is comparable).
Yes, it may depend on how you populate series, if text labels are provided for each point, on how axes labels style is set, etc. Having all those properties coded (either design-time created or run-time code) makes our job much easier than having to play with chart editor combinations and possibly missing something. That's the reason why I'm asking for a simple example project to see how such charts are exactly created. Then we can comment in parts of the code to see if there's any specific setting causing the problem or if it's just a feature that doesn't work correctly.

Thanks in advance.
Best Regards,
Narcís Calvet / 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

Uli
Newbie
Newbie
Posts: 80
Joined: Thu Apr 22, 2010 12:00 am

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Uli » Thu Jul 08, 2010 10:07 am

Hi Narcis,
Yes, it may depend on how you populate series, if text labels are provided for each point, on how axes labels style is set, etc. Having all those properties coded (either design-time created or run-time code) makes our job much easier than having to play with chart editor combinations and possibly missing something. That's the reason why I'm asking for a simple example project to see how such charts are exactly created. Then we can comment in parts of the code to see if there's any specific setting causing the problem or if it's just a feature that doesn't work correctly.
You can make another thing: Instead of creating the synthetic series try to load test2.fxy. You will get a chart comparable with that of my initial message. The axis labels are expected to be equally spaced on the x axis as in my image test2.jpg or test2a.jpg but they are not: I assume the label values were these one would calculate for a linear axis but not for a logarithmic one. And now try the chart editor to make an appropriate labeling: I was not able to get the expected behavior.
This works fine for me here using the sources with the fix for TF02014882 as can be seen here:
...
...
This fix will be included in next maintenance release.
Can you provide this fix for me immediately? Otherwise:
This means I can not work!

Regards


Uli

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Narcís » Thu Jul 08, 2010 10:55 am

Hi Uli,
You can make another thing: Instead of creating the synthetic series try to load test2.fxy. You will get a chart comparable with that of my initial message. The axis labels are expected to be equally spaced on the x axis as in my image test2.jpg or test2a.jpg but they are not: I assume the label values were these one would calculate for a linear axis but not for a logarithmic one. And now try the chart editor to make an appropriate labeling: I was not able to get the expected behavior.
Yes, but I can't easily find that. Chart editor has many options and I may miss some property or combination. On the other hand, code gives no option to doubts :wink:. We need to get to the root of the problem to see under which circumstances this occurs and try to find a solution to it. Until we have a consistent way to reproduce the issue we won't be able to search for a solution.

Having said that, I'm trying to create a chart similar to yours from scratch. I exported your data to a XML file, which I attach, and wrote the code snippet below to load it into a clean chart. Code below only loads series with standard settings and its data. Could you please help us modifying the code below to get a chart similar to your problematic one?

Code: Select all

      tChart1.Clear();

      Steema.TeeChart.Data.XmlSource xmlSource1 = new Steema.TeeChart.Data.XmlSource(tChart1.Chart);
      xmlSource1.Load(@"c:\temp\UliLogData.xml");

      tChart1.Legend.Visible = false;
      tChart1.Aspect.View3D = false;

      tChart1.Axes.Bottom.Logarithmic = true;
      tChart1.Axes.Left.Logarithmic = true;

      foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
      {
        if (s is Steema.TeeChart.Styles.CustomPoint)
        {
          (s as Steema.TeeChart.Styles.CustomPoint).Pointer.Visible = true;
        }
      }
Thanks in advance.
Can you provide this fix for me immediately? Otherwise:
This means I can not work!
Which Visual Studio version are you using?
Attachments
UliLogData.zip
(776 Bytes) Downloaded 1065 times
Best Regards,
Narcís Calvet / 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

Uli
Newbie
Newbie
Posts: 80
Joined: Thu Apr 22, 2010 12:00 am

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Uli » Thu Jul 08, 2010 11:24 am

Hi Narcis,

I use VS 2010 Pro.
Yes, but I can't easily find that. Chart editor has many options and I may miss some property or combination. On the other hand, code gives no option to doubts :wink:. We need to get to the root of the problem to see under which circumstances this occurs and try to find a solution to it. Until we have a consistent way to reproduce the issue we won't be able to search for a solution.

Having said that, I'm trying to create a chart similar to yours from scratch. I exported your data to a XML file, which I attach, and wrote the code snippet below to load it into a clean chart. Code below only loads series with standard settings and its data. Could you please help us modifying the code below to get a chart similar to your problematic one?
OK, I will check it. The problematic file was created with my old application written in Pascal. And, of course, not all properties have an equivalent in TeeChart so something might be gone wrong during conversion. Additionally, I heavily use tags to store experimental parameter or rich text strings.

I have the possibility (it may take some time to figure it out) to only import the data from my old file format. That's comparable to your attempt with the XML file. May be that's another way to come closer to the problem.

Best regards

Uli

Added:
I just checked your code: when At the xmlsource1.Load command executes I get the following error message (in both VB and c#):

System.FormatException wurde nicht behandelt.
Message=Die Eingabezeichenfolge hat das falsche Format.
Source=mscorlib
StackTrace:
bei System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
bei System.Convert.ToDouble(String value)
bei Steema.TeeChart.Data.XmlSource.LoadSeriesNode(XPathNavigator node, String nameSpaceURI)
bei Steema.TeeChart.Data.XmlSource.Load(XmlDocument d)
bei Steema.TeeChart.Data.XmlSource.Load(String fileName)
bei WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in d:\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:Zeile 28.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei WindowsFormsApplication1.Program.Main() in d:\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:Zeile 18.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException:

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Narcís » Thu Jul 08, 2010 1:31 pm

Hi Uli,
I use VS 2010 Pro.
I'll send you an e-mail with the URL a VS2010 assembly I just built.
OK, I will check it. The problematic file was created with my old application written in Pascal. And, of course, not all properties have an equivalent in TeeChart so something might be gone wrong during conversion. Additionally, I heavily use tags to store experimental parameter or rich text strings.

I have the possibility (it may take some time to figure it out) to only import the data from my old file format. That's comparable to your attempt with the XML file. May be that's another way to come closer to the problem.
Great, thanks!
I just checked your code: when At the xmlsource1.Load command executes I get the following error message (in both VB and c#):
This works fine for me. What do you use as decimal and thousand separators? You could try changing them in the XML file.
Best Regards,
Narcís Calvet / 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

Uli
Newbie
Newbie
Posts: 80
Joined: Thu Apr 22, 2010 12:00 am

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Uli » Thu Jul 08, 2010 2:45 pm

Hi Narcis,

Thanks for the new assembly, I will try it tomorrow.

You were right, I changed the separators to my settings ("." and space). But by viewing the xml file I noticed that wrong data were in it, correct data you may find in the attached zip. In the original data (and that you can view in the "data" page of the chart editor) only one value has x=0. In your xml file i it seems to be that all data points with x<0.001 were set to x=0.

There is possibly a related phenomenon what I noticed sometimes in the last days nearby: If I set (in the chart editor) the axis increment to a value<0.001 then the axis editor displays "0" after closing the input box. Not sure that it is a general problem since I did not really work with the application (you know, why). Possibly this is related to the things we discuss here.

I did a further test with the synthetic data (see above): When I add a point with x=0 to the series no points were drawn.
When I then toggle between linear/log scale then some points were drawn but still wrong.

In this experiment axis were set to scale automatically. So possibly range checking is wrong: The chart should calculate the axis minimum on the basis of the smallest x > 0. In opposite to that synthetic sample the test2.fxy was imported from my old file format under applying the axis min/max values set in the old data file ("manual" scales). I checked my import class during data import: the axes.bottom.minimum was correctly set to 0.00003xxx. But in the chart editor the axis minimum is displayed as "0". According to the import autoscaling is disabled.

Regards

Uli
Attachments
test_2.zip
(1 KiB) Downloaded 1104 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Bug in Axis.CalcPosPoint (log scales)

Post by Narcís » Thu Jul 08, 2010 3:03 pm

Hi Uli,

Thanks for your feedback. I could load your text files into a chart using code below, which produces this chart:
UliChart.png
UliChart.png (9.54 KiB) Viewed 26467 times
Is this similar to what you are looking for? What do you miss here? Can you try implementing it in the code snippet below?

Code: Select all

      tChart1.Clear();

      for (int i = 0; i < 3; i++)
      {
        tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
                
        Steema.TeeChart.Data.TextSource ts = new Steema.TeeChart.Data.TextSource();
        try
        {
          Cursor = Cursors.WaitCursor;
          ts.HeaderLines = 1;
          ts.Separator = '\t';
          ts.Series = tChart1[i];
          ts.Fields.Add(0, "X");
          ts.Fields.Add(1, "Y");
          ts.LoadFromFile(@"C:\temp\test_2\test_" + (i+1).ToString() + ".txt");
        }
        finally
        {
          Cursor = Cursors.Default;
        }
      }

      tChart1.Legend.Visible = false;
      tChart1.Aspect.View3D = false;

      tChart1.Axes.Bottom.Logarithmic = true;
      tChart1.Axes.Left.Logarithmic = true;

      foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
      {
        if (s is Steema.TeeChart.Styles.CustomPoint)
        {
          (s as Steema.TeeChart.Styles.CustomPoint).Pointer.Visible = true;
        }
      }
Thanks in advance.
Best Regards,
Narcís Calvet / 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