
06/12/2006, 12:43
|
| | Fecha de Ingreso: septiembre-2005
Mensajes: 17
Antigüedad: 19 años, 7 meses Puntos: 0 | |
Utilizar ChartSpace web components Como están los grandes programadores que hacen posible este gran sitio.
Espero que me ayuden con mi problema. Estoy trabajando con el componente chartspace en vb6, y el asunto es con un ejemplo específico que no lo puedo hacer correr y necesito este ejemplo porque no utiliza una bd para llenar el gráfico. Marcaré en negrita los principales problemas de compilación.
Private Sub Command1_Click()
'Create arrays for the x-values and the y-values
Dim xValues As Variant, yValues1 As Variant, yValues2 As Variant
xValues = Array("Beverages", "Condiments", "Confections", _
"Dairy Products", "Grains & Cereals", _
"Meat & Poultry", "Produce", "Seafood")
yValues1 = Array(104737, 50952, 78128, 117797, 52902, 80160, 47491, _
62435)
yValues2 = Array(20000, 15000, 36000, 56000, 40000, 18000, 20000, _
33000)
'Create a new chart
Dim oChart As WCChart
ChartSpace1.Clear
ChartSpace1.Refresh
Set oChart = ChartSpace1.Charts.Add
'Add a title to the chart
oChart.HasTitle = True
oChart.Title.Caption = "Sales Per Category"
'Add a series to the chart with the x-values and y-values
'from the arrays and set the series type to a column chart
Dim oSeries As WCSeries
Set oSeries = oChart.SeriesCollection.Add
With oSeries
.Caption = "1995"
.SetData chDimCategories, chDataLiteral, xValues
.SetData chDimValues, chDataLiteral, yValues1
.Type = chChartTypeColumnClustered
End With
'Add another series to the chart with the x-values and y-values
'from the arrays and set the series type to a line chart
Set oSeries = oChart.SeriesCollection.Add
With oSeries
.Caption = "1996"
.SetData chDimCategories, chDataLiteral, xValues
.SetData chDimValues, chDataLiteral, yValues2
.Type = chChartTypeLineMarkers
End With
'Add a value axis to the right of the chart for the second series
oChart.Axes.Add oChart.Axes(chAxisPositionLeft).Scaling, _
chAxisPositionRight, chValueAxis
'Format the Value Axes
oChart.Axes(chAxisPositionLeft).NumberFormat = "$#,##0"
oChart.Axes(chAxisPositionRight).NumberFormat = "0"
oChart.Axes(chAxisPositionLeft).MajorUnit = 20000
oChart.Axes(chAxisPositionRight).MajorUnit = 20000
'Show the legend at the bottom of the chart
oChart.HasLegend = True
oChart.Legend.Position = chLegendPositionBottom
End Sub
Este ejemplo lo baje de la página de MSDN, pero no lo puedo hacer correr. Si pueden ayudarme o mostrarme otro ejemplo se los agradeceré. |