Creates a sectioned Pie chart that can show legends, and pie section values connected to each segment of the pie chart.

 

Notes:

Do not use the SetPlotArea function with PIE charts because they don't support adjustable overlays.

 

Syntax:

Chart.NewPie( ChartTitle, xAxisWidth, yAxisHeight, _

            AsSeries(pieChartValues), AsSeries(pieLabels), PieSections, [Option] )

 

Parameter:

Description:

ChartTitle

String variable. Name to display in pie chart's title bar area.

xAxisWidth

Horizontal pixel external width of chart.

yAxisHeight

Vertical pixel external height of chart.

pieChartValues

BPV numeric series of pie section value.  

pieLabels

BPV String series of pie section names.

 

Note:

Use with all BPV Numeric or String series that are passed to any Chart parameter.

AsSeries(...) function conditions the series so the chart function will be able to use the information contained within each of the series elements.

PieSections

pieChartValue sectopm and pieLabels series.

[Option]

Option create an upper left corner light source shadow behind the lower right area of the pie chart image so that is it appears to stand above the background area.

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  PIE CHART - Script Example from the Pie Charts Blox
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Establish Chart image size
iChartWidth = 500   '  X-Axis Width
iChartHeight = 300   '  Y-Axis Height
 
'  Create Random Pie Segment Values
pieChartValues[1] = Random(10000)
pieChartValues[2] = Random(10000)
pieChartValues[3] = Random(10000)
pieChartValues[4] = Random(10000)
pieChartValues[5] = Random(10000)
pieChartValues[6] = Random(10000)
 
'  Pie Label Values
pieLabels[1] = "Metals"
pieLabels[2] = "Grains"
pieLabels[3] = "Softs"
pieLabels[4] = "Financials"
pieLabels[5] = "Treasuries"
pieLabels[6] = "Energies"
 
'  Create a Pie graph, use 6 numeric pieChartValues values
'  add 6 segment pieLabel names, do not use "shadow" option.
chart.NewPie( "Profit Contribution by Sector", iChartWidth, iChartHeight, _
              AsSeries(pieChartValues), AsSeries(pieLabels), 6 )
             
'  Create & Save this new chart as a file.
'  Always add a backSlash Character after "resultsReportPath"
chart.Make( test.resultsReportPath + "\" + "PieChart.png" )

Returns:

PieChart (500-300) 1-16-2013 3-15-23 PM

Shadow styling around image was added later by graphics editing program

 

Links:

AsSeries, Make, NewPie, Random, resultsReportPath

See Also:

Chart

 


Edit Time: 9/25/2017 09:09:54 AM


Topic ID#: 433

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software