Page 1 of 1

3D Bubble Series? Or Point3D with cylinders?

Posted: Wed Apr 05, 2006 4:32 am
by 9637330
I'm using TeeChart .NET v2 and I need to create a chart that looks like this:

Image

I can use the SurfacePlot series to do the colored surface, but I haven't figured out how to do the 3D cylinders. Each cylindar represents a X,Y,Z, where the height of the cylinder is the Z value. So, it is the same data as a Bubble series, only instead of the Z value being the radius of the circle, its the height of the cylinders. Its also the same as a Point3D series, but I need to draw the entire cylinder (down to 0 point on axis), not just the point.

Any suggestions on how this could be done?

Thanks.

Posted: Wed Apr 05, 2006 8:00 am
by narcis
Hi mweaver,

I think the best option here is using a Tower series setting its style to a cylinder. Tower series has X, Y and Z values. Y value determines the tower height and color.

Posted: Thu Apr 06, 2006 4:04 am
by 9637330
Thanks, I've been playing with the Tower series and I think it will do most of what I need to do. Here is the sample code I'm using:

Code: Select all


		Dim surface As New Steema.TeeChart.Styles.Surface(Me.tChart.Chart)
		With surface
			.IrregularGrid = True
			.UseColorRange = True
			.Add(1, 1, 1)
			.Add(1, 4, 20)
			'.Add(10, 6, 10)
			.Add(20, 1, 1)
			.Add(20, 3, 20)
		End With
		Me.tChart.Series.Add(surface)

		Dim tower As New Steema.TeeChart.Styles.Tower(Me.tChart.Chart)
		With tower
			.TowerStyle = Steema.TeeChart.Styles.TowerStyles.Cylinder
			.IrregularGrid = True
			.UseOrigin = True
			.Add(2, 9.5, 4)
			.Add(6, 12.8, 19)
			.Add(16, 6.2, 12)
			'.Add(85, 16.1, 10)
		End With
		Me.tChart.Series.Add(tower)

		With Me.tChart.Axes.Left
			.AutomaticMinimum = False
			.Minimum = 0
		End With

		Me.tChart.Walls.Visible = True

		Me.tChart.Aspect.View3D = True
		Me.tChart.Legend.Visible = False
		Me.tChart.Aspect.Chart3DPercent = 50
		Me.tChart.Walls.Back.Transparent = True
		Me.tChart.Walls.Left.Transparent = True
		Me.tChart.Walls.Bottom.Transparent = True

		Me.tChart.Aspect.Orthogonal = True

		Me.tChart.Axes.Depth.Visible = True
		Me.tChart.Axes.Depth.Grid.Visible = False
It kind of works, but I have a few questions:

(1) The cylinders are not round, they are oval shape. How can I control the diameter/radius of the cylinders?

(2) The surface series doesn't always hide the cylinders as expected. If you rotate the chart around, there are several viewing angles where the surface plot should be hiding the bottom part of the cylinder, but it doesn't. Any suggestions?

Thanks.[/list]

Posted: Thu Apr 06, 2006 11:53 am
by narcis
Hi mweaver,

Code: Select all

(1) The cylinders are not round, they are oval shape. How can I control the diameter/radius of the cylinders?
We are conscious that some work needs to be done here but for now there are a couple of ways to achieve what you request. Those solutions are setting Chart3DPercent to 100 or setting tower's PercentWidth to 50

Code: Select all

(2) The surface series doesn't always hide the cylinders as expected. If you rotate the chart around, there are several viewing angles where the surface plot should be hiding the bottom part of the cylinder, but it doesn't. Any suggestions?


I've been able to reproduce the problem here. To have this working you need to use Open GL. Steema Software designed Open GL rendering to solve cases like that.