Basic features of Contour and ColorGrid series

TeeChart for ActiveX, COM and ASP
Post Reply
ModelTech
Newbie
Newbie
Posts: 28
Joined: Tue Oct 09, 2007 12:00 am

Basic features of Contour and ColorGrid series

Post by ModelTech » Tue Dec 04, 2007 9:47 am

Hi,

I try to use Contour and ColorGrid series via VBScript. I have read topics related these series on this Forum and have fined some useful hints. Also I have read examples in TeeChartv8FeatureDemo.exe.

But I still have some questions about basic features of Contour and ColorGrid series (such as adding XY data, adding data Array, real XY coordinates plots, etc.). Where can I read full description of this features: possible arguments, etc?

Thanks in advance,
Danila.

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

Post by Narcís » Tue Dec 04, 2007 12:43 pm

Hi Danila,

Have you read this thread?

If so, which are the exact questions you have about that?

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

ModelTech
Newbie
Newbie
Posts: 28
Joined: Tue Oct 09, 2007 12:00 am

Post by ModelTech » Tue Dec 04, 2007 1:53 pm

Hi, Narcís,

Thanks for assistance.

I have red this thread. But this thread is related to SurfaceSeries. It is also very interesting, but my question is not about SurfaceSeries.

I think that the best way wil be the asking exact questions. Since all questions will be related to Contour and ColorGrid Series I will ask in this thread.

1. I try to set ColorGrid Series:

Code: Select all

 XZArray = (1, 2, 3, 4, 5, 6, 7, 8, 9)
Chart6.Series(0).asColorGrid.AddArrayGrid 3, 3, XZArray
But the graph does not display (and there are no errors in IExlorer status bar). Where I'm wrong?

2. How can I display contours based on information defined in ColorGrid Series. May be there are some special methods to do this?

BTW, send me please file "TeeChartx7.hlp".

Thanks in advance,
Danila.

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

Post by Narcís » Tue Dec 04, 2007 2:23 pm

Hello Danila,

Yes, the thread I mentioned is about Surface series but the same principles apply to ColorGrid and Contour series. Maybe I didn't explain myself correctly but that's the reason I pointed you to that thread.

Regarding your questions:

1. Could you please try populating your ColorGrid with data as in the thread I pointed you?

2. As mentioned above, same methods apply for Surface, ColorGrid and Contour series.

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

ModelTech
Newbie
Newbie
Posts: 28
Joined: Tue Oct 09, 2007 12:00 am

Post by ModelTech » Tue Dec 04, 2007 2:46 pm

Narcís,

thank you for the patience :)

I try to populate ColorGrid like in thread you have pointed. The code is listed below. Unfortunately, it does not work :(

Code: Select all

SUB FillChart
    Chart6.Environment.IEPrintWithPage=True
    Chart6.RemoveAllSeries
	Chart6.Legend.CheckBoxes = True
	Chart6.Zoom.Pen.Color = vbBlack
	Chart6.Environment.MouseWheelScroll = False
 
	Chart6.AddSeries(30)
    Chart6.Series(0).Title="Series 1"
    Chart6.Series(0).Clear 
    Chart6.Series(0).asColorGrid.IrregularGrid = True 
    Chart6.Series(0).asColorGrid.UseColorRange = True 
	Chart6.Series(0).asColorGrid.CenteredPoints = True

	XVal = Array(0.1, 0.2, 0.3, 0.5, 0.8, 1.1, 1.5, 2, 2.2, 3) 
	ZVal = Array(0.5, 0.6, 0.7, 0.75, 0.8, 1.1, 1.5, 2, 2.2, 5.6) 
	Pi = 3.141592 

	For X = 0 To 9 
        For Z = 0 To 9 
            Y = Sin(Z * Pi / 10) * Cos(X * Pi / 5) 
            Chart6.Series(0).asColorGrid.AddXYZ XVal(X), Y, ZVal(Z), "", 00FF00 
        Next Z 
    Next X 

// Header
    Chart6.Header.Text.Clear()
    Chart6.Header.Text.Add("TEST")
    Chart6.Header.Font.Size=10
    Chart6.Header.Font.Name="Arial"
    Chart6.Header.Font.Bold=true
// Legend
	Chart6.Legend.Visible=False
    Chart6.Panel.Color = RGB(255, 255, 255)
// Axis 
    Chart6.Axis.Left.Title.Caption="Z"
    Chart6.Axis.Left.Labels.Size=30
    Chart6.Axis.Bottom.Labels.Size=30
	Chart6.Aspect.View3D = False
    Chart6.Axis.Bottom.Labels.Style=2
    Chart6.Axis.Bottom.Title.Caption="X"

End Sub  

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

Post by Narcís » Tue Dec 04, 2007 2:59 pm

Hi Danila,

This is because your data doesn't have a grid structure. To define a grid/surface's cell bounds at least you need four points (top, bottom, left and right).

For an example try populating your series like this:

Code: Select all

   For X = 0 To 9
        For Z = 0 To 9
            Y = Sin(Z * Pi / 10) * Cos(X * Pi / 5)
            Chart6.Series(0).asColorGrid.AddXYZ X, Y, Z, "", 00FF00
        Next Z
    Next X 
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

ModelTech
Newbie
Newbie
Posts: 28
Joined: Tue Oct 09, 2007 12:00 am

Post by ModelTech » Tue Dec 04, 2007 3:20 pm

Why my data doesn't have a grid structure? I use Chart6.Series(0).asColorGrid.IrregularGrid = True
and I define arrays of XVal and ZVal.

BTW: Your last code also does not work.

Thank you for help-file!

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

Post by Narcís » Wed Dec 05, 2007 9:24 am

Hi Danila,

Sorry, I looked at your code too quickly. Your data certainly has grid-like structure. In fact, your code works fine in a VB6 project. We will investigate why it doesn't work in a VBScript application and get back to you when we have further news.
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

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

Post by Narcís » Fri Dec 07, 2007 11:58 am

Hi Danila,

I've just sent you a working example in VBScript.
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

ModelTech
Newbie
Newbie
Posts: 28
Joined: Tue Oct 09, 2007 12:00 am

Post by ModelTech » Mon Dec 17, 2007 2:19 pm

Hi, Narcís!

Thank you for the example.

Regards,
Danila.

adenin
Newbie
Newbie
Posts: 33
Joined: Mon Jun 11, 2007 12:00 am

Post by adenin » Wed Jan 21, 2009 12:44 pm

narcis wrote:Hi Danila,

I've just sent you a working example in VBScript.
Hello Narcis,

Could you please send me mentioned working example?
Thanks

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

Post by Narcís » Wed Jan 21, 2009 12:55 pm

Hi adenin,

Sure, just sent it.
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