Published on :
Reporting SASHELP

3D Bar Chart of Shoe Sales

This code is also available in: Deutsch Español Français
The script configures graphics options to use the ACTXIMG device. It then opens an ODS HTML destination to write the graphical output to 'c:\test.html', with the generated images in the 'c:\' folder. The GCHART procedure is used to create a 3D bar chart ('vbar3d') displaying the sum of sales ('sumvar=sales') by product ('product') from the SASHELP.SHOES table. Finally, the ODS HTML destination is closed to finalize the file creation.
Data Analysis

Type : SASHELP


The script uses the 'SHOES' table from the SASHELP library, which contains sample data on shoe sales by product.

1 Code Block
ODS and Graph Configuration
Explanation :
This block initializes graphics options, specifying the 'actximg' graphics output device. It then configures the Output Delivery System (ODS) to generate HTML output, directing the document body to 'c:\test.html' and graphic files to the same 'c:\' directory.
Copied!
1goptions device=actximg ;
2/*goptions device=javaimg ;*/
3ods html body='c:\test.html'
4 gpath='c:\'
5 (url=none) ;
2 Code Block
PROC GCHART
Explanation :
This block uses the GCHART procedure to create a graph. It specifies the 'sashelp.shoes' table as the data source. The 'vbar3d product / sumvar=sales' statement generates a 3D bar chart, where the bars represent different values of the 'product' variable and their length is determined by the sum of the 'sales' variable.
Copied!
1 
2PROC GCHART
3DATA=sashelp.shoes ;
4vbar3d product / sumvar=sales ;
5RUN ;
6 
3 Code Block
ODS HTML
Explanation :
This block closes the previously opened ODS HTML destination. This finalizes the creation of the 'c:\test.html' file and ensures that all subsequent ODS output is not directed to this file.
Copied!
1ods html close ;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.