|
3D scatter chart weird data coming through |
Posted by icm63 on Mar-15-2013 03:25 |
|
First the code to populate 3D scatter chart with lots of groups.
Public Sub AddData(ByVal DataName As String, ByVal xData() As Double, ByVal yData() As Double, _
ByVal zData() As Double, ByVal DataShape As Integer)
Util.zPFile(DataName & " / " & DataShape.ToString & " / " & xData(0).ToString & " / " & yData(0).ToString & " / " & zData(0).ToString & " / " & xData.GetUpperBound(0).ToString & " / " & yData.GetUpperBound(0).ToString & " / " & zData.GetUpperBound(0).ToString)
Dim symbols() As Integer = {Chart.CircleShape, _
Chart.GlassSphereShape, _
Chart.GlassSphere2Shape, _
Chart.SolidSphereShape, _
Chart.SquareShape, _
Chart.DiamondShape, _
Chart.TriangleShape, _
Chart.RightTriangleShape, _
Chart.LeftTriangleShape, _
Chart.InvertedTriangleShape, _
Chart.StarShape(3), _
Chart.StarShape(4), _
Chart.StarShape(5), _
Chart.StarShape(6), _
Chart.StarShape(7), _
Chart.StarShape(8), _
Chart.StarShape(9), _
Chart.StarShape(10), _
Chart.PolygonShape(5), _
Chart.Polygon2Shape(5), _
Chart.PolygonShape(6), _
Chart.Polygon2Shape(6), _
Chart.CrossShape(0.1), _
Chart.CrossShape(0.2), _
Chart.CrossShape(0.3), _
Chart.CrossShape(0.4), _
Chart.CrossShape(0.5), _
Chart.CrossShape(0.6), _
Chart.CrossShape(0.7), _
Chart.Cross2Shape(0.1)}
Dim g As ThreeDScatterGroup = c.addScatterGroup(xData, yData, zData, DataName, symbols(DataShape), 11)
g.setDropLine(&H3FBA47)
End Sub
The code that starts with 'Util.zPFile' is my Debug.Print data hitting the code.
The output is and this is the EXACT data going into c.AddScarrerGroup (the first 5 data points)
XHB / 0 / 12.8825 / 5.37 / 24.5118 / 1 / 1 / 1
XLE / 1 / 13.922 / 6.89 / 18.3071 / 1 / 1 / 1
XLF / 2 / 17.9052 / 3.92 / 16.6181 / 1 / 1 / 1
XLI / 3 / 14.4423 / 4.83 / 15.0844 / 1 / 1 / 1
XLK / 4 / 10.2606 / 0.98 / 15.2868 / 1 / 1 / 1
XLP / 5 / 10.2063 / 4.25 / 10.3914 / 1 / 1 / 1
XLU / 6 / 9.9322 / 4.35 / 9.8551 / 1 / 1 / 1
XLV / 7 / 13.6241 / 3.47 / 11.355 / 1 / 1 / 1
XLY / 8 / 12.9954 / 4.07 / 14.2644 / 1 / 1 / 1
XME / 9 / -0.1812 / -2.72 / 27.7771 / 1 / 1 / 1
XRT / 10 / 11.9631 / 7.44 / 17.0772 / 1 / 1 / 1
BUT as you see in the next two images the XLE data is shown twice, when its only be posted into scatter chance once?
Any ideas??
|
Re: 3D scatter chart weird data coming through |
Posted by Peter Kwan on Mar-15-2013 18:31 |
|
Hi icm63,
Acoording to your display "XLE / 1 / 13.922 / 6.89 / 18.3071 / 1 / 1 / 1", there should be two data points for XLE. In the chart, there are in fact two data points, so there is no inconsistency. Would you mind to clarify where is the error?
(Are you aware what does GetUpperBound mean? If GetUpperBound returns 1, it means there are 2 elements in the array.)
Hope this can help.
Regards
Peter Kwan |
Re: 3D scatter chart weird data coming through |
Posted by icm63 on Mar-16-2013 00:37 |
|
Silly me..
You are correct.
Thanks for your help. |
|