第十三章
首先下载一些数据,然后将它们添加到Excel并创建一个图表。
// Add new item to the charts collection
let chartobjects = (worksheet.ChartObjects() :?> ChartObjects)
let chartobject = chartobjects.Add(400.0, 20.0, 550.0, 350.0)
// Configure the chart using the wizard
chartobject.Chart.ChartWizard
(Title = "Area covered by forests",
Source = worksheet.Range("B2", "E" + endColumn),
Gallery = XlChartType.xl3DColumn, PlotBy = XlRowCol.xlColumns,
SeriesLabels = 1, CategoryLabels = 1,
CategoryTitle = "", ValueTitle = "Forests (mil km^2)")
// Set graphical style of the chart
chartobject.Chart.ChartStyle <- 5