<HTML>
<BODY>
<h1>HTML + VBSCRIPT + Microsoft Office Excel Interop...</h1>
<INPUT id=button1 name=button1 type=button value="Tampilkan Excel Chart">
<SCRIPT LANGUAGE="VBScript">
sub button1_onclick()
' Launch Excel
dim app
set app = createobject("Excel.Application")
' Make it visible
app.Visible = true
' Add a new workbook
dim wb
set wb = app.workbooks.add
' Fill array of values first...
dim arr(19,9) ' Note: VBScript is zero-based
for i = 1 to 20
for j = 1 to 10
arr(i-1,j-1) = i*j
next
next
' Declare a range object to hold our data
dim rng
set rng = wb.Activesheet.Range("A1").Resize(20,10)
' Now assign them all in one shot...
rng.value = arr
' Add a new chart based on the data
wb.Charts.Add
wb.ActiveChart.ChartType = 98
wb.ActiveChart.SetSourceData rng, 2 ' xlColumns
wb.ActiveChart.Location 2, "Sheet1" 'xlLocationAsObject
' Rotate it around...
for i = 1 to 360 step 30
wb.activechart.rotation = i
next
' Give the user control of Excel
app.UserControl = true
end sub
</SCRIPT>
</BODY>
</HTML>
XlChartType enumeration (Excel)
Specifies the chart type.
| Name | Value | Description |
|---|---|---|
| xl3DArea | -4098 | 3D Area. |
| xl3DAreaStacked | 78 | 3D Stacked Area. |
| xl3DAreaStacked100 | 79 | 100% Stacked Area. |
| xl3DBarClustered | 60 | 3D Clustered Bar. |
| xl3DBarStacked | 61 | 3D Stacked Bar. |
| xl3DBarStacked100 | 62 | 3D 100% Stacked Bar. |
| xl3DColumn | -4100 | 3D Column. |
| xl3DColumnClustered | 54 | 3D Clustered Column. |
| xl3DColumnStacked | 55 | 3D Stacked Column. |
| xl3DColumnStacked100 | 56 | 3D 100% Stacked Column. |
| xl3DLine | -4101 | 3D Line. |
| xl3DPie | -4102 | 3D Pie. |
| xl3DPieExploded | 70 | Exploded 3D Pie. |
| xlArea | 1 | Area. |
| xlAreaEx | 135 | Area Ex. |
| xlAreaStacked | 76 | Stacked Area. |
| xlAreaStacked100 | 77 | 100% Stacked Area. |
| xlAreaStacked100Ex | 137 | 100% Stacked Area Ex. |
| xlAreaStackedEx | 136 | Stacked Area Ex. |
| xlBarClustered | 57 | Clustered Bar. |
| xlBarClusteredEx | 132 | Clustered Bar Ex. |
| xlBarOfPie | 71 | Bar of Pie. |
| xlBarStacked | 58 | Stacked Bar. |
| xlBarStacked100 | 59 | 100% Stacked Bar. |
| xlBarStacked100Ex | 134 | 100% Stacked Bar Ex. |
| xlBarStackedEx | 133 | Stacked Bar Ex. |
| xlBoxwhisker | 121 | Box & Whisker. |
| xlBubble | 15 | Bubble. |
| xlBubble3DEffect | 87 | Bubble with 3D effects. |
| xlBubbleEx | 139 | Bubble Ex. |
| xlColumnClustered | 51 | Clustered Column. |
| xlColumnClusteredEx | 124 | Clustered Column Ex. |
| xlColumnStacked | 52 | Stacked Column. |
| xlColumnStacked100 | 53 | 100% Stacked Column. |
| xlColumnStacked100Ex | 126 | 100% Stacked Column Ex. |
| xlColumnStackedEx | 125 | Stacked Column Ex. |
| xlCombo | -4152 | Custom Combination. |
| xlComboAreaStackedColumnClustered | 115 | Stacked Area - Clustered Column. |
| xlComboColumnClusteredLine | 113 | Clustered Column - Line. |
| xlComboColumnClusteredLineSecondaryAxis | 114 | Clustered Column - Line on Secondary Axis. |
| xlConeBarClustered | 102 | Clustered Cone Bar. |
| xlConeBarStacked | 103 | Stacked Cone Bar. |
| xlConeBarStacked100 | 104 | 100% Stacked Cone Bar. |
| xlConeCol | 105 | 3D Cone Column. |
| xlConeColClustered | 99 | Clustered Cone Column. |
| xlConeColStacked | 100 | Stacked Cone Column. |
| xlConeColStacked100 | 101 | 100% Stacked Cone Column. |
| xlCylinderBarClustered | 95 | Clustered Cylinder Bar. |
| xlCylinderBarStacked | 96 | Stacked Cylinder Bar. |
| xlCylinderBarStacked100 | 97 | 100% Stacked Cylinder Bar. |
| xlCylinderCol | 98 | 3D Cylinder Column. |
| xlCylinderColClustered | 92 | Clustered Cone Column. |
| xlCylinderColStacked | 93 | Stacked Cone Column. |
| xlCylinderColStacked100 | 94 | 100% Stacked Cylinder Column. |
| xlDoughnut | -4120 | Doughnut. |
| xlDoughnutEx | 131 | Doughnut Ex. |
| xlDoughnutExploded | 80 | Exploded Doughnut. |
| xlFunnel | 123 | Funnel. |
| xlHistogram | 118 | Histogram |
| xlLine | 4 | Line. |
| xlLineEx | 127 | Line Ex. |
| xlLineMarkers | 65 | Line with Markers. |
| xlLineMarkersStacked | 66 | Stacked Line with Markers. |
| xlLineMarkersStacked100 | 67 | 100% Stacked Line with Markers. |
| xlLineStacked | 63 | Stacked Line. |
| xlLineStacked100 | 64 | 100% Stacked Line. |
| xlLineStacked100Ex | 129 | 100% Stacked Line Ex. |
| xlLineStackedEx | 128 | Stacked Line Ex. |
| xlOtherCombinations | 116 | Other Combinations. |
| xlPareto | 122 | Pareto. |
| xlPie | 5 | Pie. |
| xlPieEx | 130 | Pie Ex. |
| xlPieExploded | 69 | Exploded Pie. |
| xlPieOfPie | 68 | Pie of Pie. |
| xlPyramidBarClustered | 109 | Clustered Pyramid Bar. |
| xlPyramidBarStacked | 110 | Stacked Pyramid Bar. |
| xlPyramidBarStacked100 | 111 | 100% Stacked Pyramid Bar. |
| xlPyramidCol | 112 | 3D Pyramid Column. |
| xlPyramidColClustered | 106 | Clustered Pyramid Column. |
| xlPyramidColStacked | 107 | Stacked Pyramid Column. |
| xlPyramidColStacked100 | 108 | 100% Stacked Pyramid Column. |
| xlRadar | -4151 | Radar. |
| xlRadarFilled | 82 | Filled Radar. |
| xlRadarMarkers | 81 | Radar with Data Markers. |
| xlRegionMap | 140 | Map chart. |
| xlStockHLC | 88 | High-Low-Close. |
| xlStockOHLC | 89 | Open-High-Low-Close. |
| xlStockVHLC | 90 | Volume-High-Low-Close. |
| xlStockVOHLC | 91 | Volume-Open-High-Low-Close. |
| xlSuggestedChart | -2 | Suggested. |
| xlSunburst | 120 | Sunburst. |
| xlSurface | 83 | 3D Surface. |
| xlSurfaceTopView | 85 | Surface (Top View). |
| xlSurfaceTopViewWireframe | 86 | Surface (Top View wireframe). |
| xlSurfaceWireframe | 84 | 3D Surface (wireframe). |
| xlTreemap | 117 | Treemap. |
| xlWaterfall | 119 | Waterfall. |
| xlXYScatter | -4169 | Scatter. |
| xlXYScatterEx | 138 | Scatter Ex. |
| xlXYScatterLines | 74 | Scatter with Lines. |
| xlXYScatterLinesNoMarkers | 75 | Scatter with Lines and No Data Markers. |
| xlXYScatterSmooth | 72 | Scatter with Smoothed Lines. |
| xlXYScatterSmoothNoMarkers | 73 | Scatter with Smoothed Lines and No Data Markers. |
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.

Tidak ada komentar:
Posting Komentar