03-22-2007 10:25 AM
03-09-2009 08:31 PM
Using sruly's method, we can create correct scatter chart type fo the data.
Does anyone know how to add titles for the chart and axes afterwords?
03-10-2009 10:24 AM
Hi -
I think you will find the following Developer Zone Tutorial: Generating Microsoft Excel Reports with LabWindows/CVI very useful for setting the attributes of a graph. Specifically, the section on Adding a Graph to the Microsoft Excel Report outlines the details for customizing Microsoft Excel graphs.
-Adri
03-10-2009 04:34 PM - edited 03-10-2009 04:37 PM
Thanks for pointing out this link to me.
For some reason, both ExcelRpt_ChartWizard() and Excel_ChartChartWizard()
cannot create correct XYScatter plot (first column = x axis values,
second column = y axis values).
I had to modify the "excelreportdemo.c" by using these functions to
create the chart that I want:
----------------------------------------------------------------------------------------------------------
ExcelRpt_ChartAddtoWorksheet (worksheetHandle, 200.0, 7.0, 4.0*72, 4.0*72, &chartHandle ) ;
ExcelRpt_ChartActivate (chartHandle);
ExcelRpt_ChartSetSourceRange (chartHandle, worksheetHandle, "B2:C7" ) ;
ExcelRpt_SetChartAttribute (chartHandle, ER_CH_ATTR_CHART_TYPE, PlotType ) ;
ExcelRpt_SetChartAttribute (chartHandle, ER_CH_ATTR_CHART_PLOT_BY, ExRConst_Columns ) ;
ExcelRpt_SetChartAttribute (chartHandle, ER_CH_ATTR_CHART_TITLE, "ChartTitle" ) ;
ExcelRpt_SetChartAttribute (chartHandle, ER_CH_ATTR_PLOTAREA_COLOR, 0xffff00 ) ; //yellow background
ExcelRpt_SetChartAxisAttribute (chartHandle, ExRConst_Category,
ExRConst_Primary,
ER_CH_ATTR_AXIS_TITLE, "X axis" ) ; //Category = X-axis
ExcelRpt_SetChartAxisAttribute (chartHandle, ExRConst_Value,
ExRConst_Primary,
ER_CH_ATTR_AXIS_TITLE, "Y axis" ) ; //Values = Y-axis
----------------------------------------------------------------------------------------------------------