XZ Grid with Y displacement

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

XZ Grid with Y displacement

Post by Anaesthesia » Tue Sep 08, 2015 9:55 pm

OpenGL3D.png
OpenGL3D.png (315.88 KiB) Viewed 21293 times
I'm attempting to emulate the surface chart entitled "XZ Grid with Y displacement" from your gallery. I can't find it in your samples. I can reproduce the charting behaviour by activating Open GL, but then the axis labels are not shown properly (See above).

Can you help?

Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

Re: XZ Grid with Y displacement

Post by Anaesthesia » Wed Sep 09, 2015 4:53 am

This illustrates the absence of labels with openGL. Also,how do I remove the dashed gray lines from the (invisible) left wall?
Attachments
OpenGL3D_2.jpg
OpenGL3D_2.jpg (483.36 KiB) Viewed 21265 times

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

Re: XZ Grid with Y displacement

Post by Christopher » Wed Sep 09, 2015 10:39 am

Hello,

To make an image similar to this:

Image

you can use the following code:

Code: Select all

    Surface series;
    private void InitializeChart()
    {
      series = new Surface(tChart1.Chart);
      series.FillSampleValues();

      tChart1.Aspect.Orthogonal = false;
      tChart1.Legend.Visible = false;
      tChart1.Aspect.Zoom = 95;
      tChart1.Aspect.Elevation = 295;
      tChart1.Aspect.Perspective = 20;
      tChart1.Aspect.Chart3DPercent = 35;
    }
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

Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

Re: XZ Grid with Y displacement

Post by Anaesthesia » Wed Sep 09, 2015 6:37 pm

EffectOfOpenGL.jpg
EffectOfOpenGL.jpg (185.75 KiB) Viewed 21190 times
I'm afraid I'm still having problems.

In the image above, the same chart (without series data) has been rendered with and without OpenGL active.

I commented in or out the code below to achieve this effect:

Steema.TeeChart.Drawing.GL.TeeOpenGL openGL = new Steema.TeeChart.Drawing.GL.TeeOpenGL(SurfaceChart.Chart);
openGL.Active = true;
openGL.ShadeQuality = true;

Can you please explain:

1. How I can remove the dashed gray lines which are positioned on the left and bottom axes?
2. How I can make the axis labelling visible in the OpenGL rendering?
3. How I can increase the font size of the axis labels (It seems to be stuck on 'Verdana 8') whatever I set in the property editor?

Many thanks,
Andy

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

Re: XZ Grid with Y displacement

Post by Christopher » Thu Sep 10, 2015 8:27 am

Hello,

Using this code:

Code: Select all

    Surface series;
    Steema.TeeChart.Drawing.GL.TeeOpenGL openGL;
    private void InitializeChart()
    {
      openGL = new Steema.TeeChart.Drawing.GL.TeeOpenGL(tChart1.Chart);
      openGL.ShadeQuality = true;
      series = new Surface(tChart1.Chart);
      //series.FillSampleValues();

      tChart1.Header.Text = "openGL.Active " + openGL.Active;
      tChart1.Aspect.Orthogonal = false;
      tChart1.Legend.Visible = false;
      tChart1.Aspect.Zoom = 95;
      tChart1.Aspect.Elevation = 295;
      tChart1.Aspect.Perspective = 20;
      tChart1.Aspect.Chart3DPercent = 35;
    }


    private void button4_Click(object sender, EventArgs e)
    {
      tChart1.Draw();
      openGL.Active = !openGL.Active;
      tChart1.Header.Text = "openGL.Active " + openGL.Active;

      tChart1.Aspect.Zoom = openGL.Active ? 60 : 95;
    }
I obtain the following images:
export635774703354528973.png
export635774703354528973.png (24.71 KiB) Viewed 21188 times
export635774703395922503.png
export635774703395922503.png (9.95 KiB) Viewed 21186 times
Can you please modify the above code so I can reproduce your issue here?
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

Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

Re: XZ Grid with Y displacement

Post by Anaesthesia » Thu Sep 10, 2015 8:55 pm

Dear Christopher,

I've solved questions 1 and 2:

1. The gray lines are the Grid lines of the Depth Axis and are removed by setting Axes.Depth.Grid.Visible to false.
2. In my version of Teechart (Steema TeeChart for .NET Source Code 2015 4.1.2015.08060) changing the font in properties (eg Axes.Bottom.Labels.Font) does not work. By default, it is set to Verdana, 8pt and it reverts to this font whatever one chooses. However, changing it by code (eg Axes.Bottom.Labels.Font.Size = 14) works quite happily.

I still not able to work out how to position axis labels correctly when open GL is active. I suspect that the labels are being printed, but in a different orientation.
I note that in your own example, when OpenGL is active, the left and bottom axis zeroes are not shown either.

Andy

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

Re: XZ Grid with Y displacement

Post by Christopher » Mon Sep 14, 2015 8:35 am

Hello Andy,
Anaesthesia wrote:I still not able to work out how to position axis labels correctly when open GL is active. I suspect that the labels are being printed, but in a different orientation.
I note that in your own example, when OpenGL is active, the left and bottom axis zeroes are not shown either.
Unfortunately this is a defect which I have added to our tracking system with id=1302. Every effort will be made to find a fix to this defect before the next maintenance release. Apologies for any inconvenience in the meantime.
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

Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

Re: XZ Grid with Y displacement

Post by Anaesthesia » Mon Sep 14, 2015 6:52 pm

Thank you. - I'm still extremely pleased with the graphs I generate!

Andy

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

Re: XZ Grid with Y displacement

Post by Christopher » Tue Sep 15, 2015 2:50 pm

Anaesthesia wrote:Thank you. - I'm still extremely pleased with the graphs I generate!
That's excellent, I'm very pleased to hear it.

I've now fixed the issue with the axis labels in OpenGL. It is a very simple fix, and if you have the source code version you may be interested in me passing it to you.
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

Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

Re: XZ Grid with Y displacement

Post by Anaesthesia » Wed Sep 16, 2015 8:17 am

Dear Christopher,

I have the source code version. Could you let me know what to do?

Andy

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

Re: XZ Grid with Y displacement

Post by Christopher » Wed Sep 16, 2015 9:21 am

Andy,
Anaesthesia wrote:I have the source code version. Could you let me know what to do?
Of course. There are two changes, both of them to the unit CanvasGL.cs under:

%Program Files%\Steema Software\Steema TeeChart for .NET Source Code 2015 4.1.2015.08060\Sources\TeeChart.OpenGL

and they are shown in the following two images:
diff1.PNG
diff1.PNG (58.13 KiB) Viewed 21103 times
diff2.PNG
diff2.PNG (58.75 KiB) Viewed 21093 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

Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

Re: XZ Grid with Y displacement

Post by Anaesthesia » Wed Sep 16, 2015 7:30 pm

When I replace the method (as shown below) and attempt to re-compile, I get:

Error 1 'Steema.TeeChart.Drawing.GL.GraphicsGL.TextOut(int, int, string, bool)': no suitable method found to override

Code Snippet:
//public override void TextOut(int x, int y, string text)
//{
// TextOut(x,y,0,text);
//}

public override void TextOut(int x, int y, string text, bool allowHtml)
{
TextOut(x, y, 0, text, false);
}

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

Re: XZ Grid with Y displacement

Post by Christopher » Wed Sep 16, 2015 7:36 pm

Anaesthesia wrote:When I replace the method (as shown below) and attempt to re-compile, I get:

Error 1 'Steema.TeeChart.Drawing.GL.GraphicsGL.TextOut(int, int, string, bool)': no suitable method found to override
In the second image I think one can see that the signature to override is slightly different, i.e.

Steema.TeeChart.Drawing.GL.GraphicsGL.TextOut(int, int, int, string, bool)

not

Steema.TeeChart.Drawing.GL.GraphicsGL.TextOut(int, int, string, bool)
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