' Create an array of strings representing the categories.
categories(0) = "15/03/2000"
categories(1) = "16/03/2000"
categories(2) = "17/03/2000"
categories(3) = "18/03/2000"
' Clear the contents of the chart workspace. This removes
' any old charts that may already exist and leaves the chart workspace
' completely empty. One chart object is then added.
ChartSpace1.Clear
ChartSpace1.Charts.Add
Set c = ChartSpace1.Constants
ChartSpace1.Charts(0).Type = c.chChartTypeStockOHLC
ChartSpace1.Charts(0).SeriesCollection(0).Caption = "Ativo X"
ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimCategories, c.chDataLiteral, categories
ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimOpenValues, c.chDataLiteral, valuesopen
ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimHighValues, c.chDataLiteral, valueshigh
ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimLowValues, c.chDataLiteral, valueslow
ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimCloseValues, c.chDataLiteral, valuesclose
' Make the chart legend visible, format the left value axis as percentage,
' and specify that value gridlines are at 10% intervals.
ChartSpace1.Charts(0).HasLegend = True
ChartSpace1.Charts(0).Axes(c.chAxisPositionLeft).MajorUnit = 1
End Sub
</script>
</td>
<td width=40%><font face=verdana,arial size=1 color=blue>This is a small
Chart Example</font></td>
</tr>
</table>