Page 1 of 1

Basic features of Contour and ColorGrid series

Posted: Tue Dec 04, 2007 9:47 am
by 15046980
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.

Posted: Tue Dec 04, 2007 12:43 pm
by narcis
Hi Danila,

Have you read this thread?

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

Thanks in advance.

Posted: Tue Dec 04, 2007 1:53 pm
by 15046980
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.

Posted: Tue Dec 04, 2007 2:23 pm
by narcis
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.

Posted: Tue Dec 04, 2007 2:46 pm
by 15046980
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  

Posted: Tue Dec 04, 2007 2:59 pm
by narcis
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 

Posted: Tue Dec 04, 2007 3:20 pm
by 15046980
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!

Posted: Wed Dec 05, 2007 9:24 am
by narcis
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.

Posted: Fri Dec 07, 2007 11:58 am
by narcis
Hi Danila,

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

Posted: Mon Dec 17, 2007 2:19 pm
by 15046980
Hi, Narcís!

Thank you for the example.

Regards,
Danila.

Posted: Wed Jan 21, 2009 12:44 pm
by 9535493
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

Posted: Wed Jan 21, 2009 12:55 pm
by narcis
Hi adenin,

Sure, just sent it.