LabWindows/CVI

ExcelRpt_ChartWizard

HRESULT ExcelRpt_ChartWizard (CAObjHandle chartHandle, CAObjHandle worksheetHandle, char sourceRange[], enum ExREnum_ExChartWizardGallery chartGallery, int format, enum ExREnum_ExRowCol plotBy, int categoryLabels, int seriesLabels, int hasLegend, char title[], char categoryAxisTitle[], char valueAxisTitle[], char extraAxisTitle[]);

Purpose

Use the chart wizard to quickly format a chart.

Parameters

Input
Name Type Description
chartHandle CAObjHandle A handle to an Excel Chart object.
worksheetHandle CAObjHandle A handle to an Excel Worksheet object.
sourceRange char [] Sets the source range for the chart. The data in the source range will be displayed on the chart.

A range of cells. This value should be a string containing the cell range, such as "A1" or "A1:D5".
chartGallery enum ExREnum_ExChartWizardGallery Specifies the type of the chart. You must select one of the following values:

ExRConst_GalleryArea = 1
ExRConst_GalleryBar = 2
ExRConst_GalleryColumn = 3
ExRConst_GalleryLine = 4
ExRConst_GalleryPie = 5
ExRConst_GalleryRadar = –4151
ExRConst_GalleryXYScatter = –4169
ExRConst_GalleryCombination = –4111
ExRConst_Gallery3DArea = –4098
ExRConst_Gallery3DBar = –4099
ExRConst_Gallery3DColumn = –4100
ExRConst_Gallery3DLine = –4101
ExRConst_Gallery3DPie = –4102
ExRConst_Gallery3DSurface = –4103
ExRConst_GalleryDoughnut = –4120
format int For each chart type value that can be selected for the chartGallery parameter, there are several formats available. This parameter can specify which of the built-in formats to use.

This value can be a number from 1 through 10, depending on the selected chart type. Pass 0 to let Excel chooses a default based on the chart type and data source.
plotBy enum ExREnum_ExRowCol Specifies whether the data for each series is in rows or columns.
categoryLabels int An integer specifying the number of rows or columns within the source range that contain category labels. Legal values are from 0 (zero) through one less than the maximum number of the corresponding categories or series.
seriesLabels int An integer specifying the number of rows or columns within the source range that contain series labels. Legal values are from 0 (zero) through one less than the maximum number of the corresponding categories or series.
hasLegend int Specify a nonzero value or select Yes in the function panel to include a legend for the chart.

Specify a nonzero value or select No in the function panel otherwise.
title char [] The chart title text. Pass NULL for no chart title.
categoryAxisTitle char [] The category axis title text. Pass NULL for no category title.
valueAxisTitle char [] The value axis title text. Pass NULL for no axis title.
extraAxisTitle char [] The series axis title for 3–D charts or the second value axis title for 2–D charts. Pass NULL for no title.

Return Value

Name Type Description
status HRESULT A value indicating whether an error occurred. Function failure is indicated by a negative error code.

Error codes are defined in CVIversion\include\cviauto.h and <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h.

You can use CA_GetAutomationErrorString to get the description of an error code.

Additional Information

Library: Excel Report

Include file: activex\excel\ExcelReport.h

LabWindows/CVI compatibility: LabWindows/CVI 7.0 and later

Log in to get a better experience