Page 1 of 1

XZ Grid with Y displacement

Posted: Tue Sep 08, 2015 9:55 pm
by 16075226
OpenGL3D.png
OpenGL3D.png (315.88 KiB) Viewed 21299 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?

Re: XZ Grid with Y displacement

Posted: Wed Sep 09, 2015 4:53 am
by 16075226
This illustrates the absence of labels with openGL. Also,how do I remove the dashed gray lines from the (invisible) left wall?

Re: XZ Grid with Y displacement

Posted: Wed Sep 09, 2015 10:39 am
by Christopher
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;
    }

Re: XZ Grid with Y displacement

Posted: Wed Sep 09, 2015 6:37 pm
by 16075226
EffectOfOpenGL.jpg
EffectOfOpenGL.jpg (185.75 KiB) Viewed 21196 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

Re: XZ Grid with Y displacement

Posted: Thu Sep 10, 2015 8:27 am
by Christopher
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 21194 times
export635774703395922503.png
export635774703395922503.png (9.95 KiB) Viewed 21192 times
Can you please modify the above code so I can reproduce your issue here?

Re: XZ Grid with Y displacement

Posted: Thu Sep 10, 2015 8:55 pm
by 16075226
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

Re: XZ Grid with Y displacement

Posted: Mon Sep 14, 2015 8:35 am
by Christopher
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.

Re: XZ Grid with Y displacement

Posted: Mon Sep 14, 2015 6:52 pm
by 16075226
Thank you. - I'm still extremely pleased with the graphs I generate!

Andy

Re: XZ Grid with Y displacement

Posted: Tue Sep 15, 2015 2:50 pm
by Christopher
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.

Re: XZ Grid with Y displacement

Posted: Wed Sep 16, 2015 8:17 am
by 16075226
Dear Christopher,

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

Andy

Re: XZ Grid with Y displacement

Posted: Wed Sep 16, 2015 9:21 am
by Christopher
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 21109 times
diff2.PNG
diff2.PNG (58.75 KiB) Viewed 21099 times

Re: XZ Grid with Y displacement

Posted: Wed Sep 16, 2015 7:30 pm
by 16075226
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);
}

Re: XZ Grid with Y displacement

Posted: Wed Sep 16, 2015 7:36 pm
by Christopher
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)