AddBarLayer can modifies the appearance of bars and enhance the 3D effect of an XYChart created to show bars or columns.
Note - 1:
This method is not required with bar charts, but when it is used the first parameter provides five methods that change the way bar are displayed on a chart. Its second parameter provides control over the chart's 3-dimensional appearance. Applying a bar display modification doesn't require the user to change the 3D effect of the chart, but both parameters can be applied at the same time.
This method must be executed ahead of when any of the chart's data is applied so that all the series are handled correctly.
Note - 2:
Chart example images have a drop shadow effect so they would appear above the background.
NewXY can automatically add a similar drop-shadow effect when the "Shadow" option is added as an option.
Syntax:
chart.AddBarLayer([BarMethodEffect],[3D_Depth])
Parameter:
Description:
[BarMethodEffect]
Bar Method Effect:
Use Value:
Overlay
0
Stack
1
Depth
2
Side (Default)
3
Percentage
4
Note:
Optional parameter, unless there is a need to change the 3D bar effect. When only a 3D effect change is needed, enter a value of 3 to use the default side-by-side bar display, or use the value of another effects when needed.
[3D_Depth]
Optional:
No value is required in this parameter location when the 3D effect doesn't need to be changed.
Bar Depth Effect:
Use Value:
Auto Adjust 3D Effect
-1
Control 3D Depth Size
Pixels depth size
Example - 1:
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Rotated XY-Axis - Horizontal Bar Chart Code ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Create with rotated X & Y Axis so bars lay horizontal ' "Vertical" option creates horizontal bars chart.NewXY("Horizontal Bar", 300, 200,"Vertical") ' 3D Plot Area Adjustment - See SetPlotArea Notes chart.SetPlotArea( 10, 30, 60, 30 ) ' See Table Notes for BarMethodEffect & 3D_Depth values chart.AddBarLayer([BarMethodEffect],[3D_Depth])' Examples -> ' Add 3 element Bar series data "bar1" chart.AddBarSeries(AsSeries( bar1 ), 3 ) ' Add 3 element Bar series data "bar2" chart.AddBarSeries(AsSeries( bar2 ), 3 ) ' Create & Save an image of the chart with ' this file name. BackSlash Character is Required ' when using ResultsReportPath chart.Make(test.resultsReportPath+"\"+ hbar.png" )
Returns - 1:
Horizontal Bar Layout Options
Group 1
Example - 2:
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Standard XY-Axis - Vertical Bar/Column Chart Code ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Create with Standard X & Y Axis Columns chart.NewXY("Horizontal Bar", 300, 200 ) ' 3D Plot Area Adjustment - See SetPlotArea Notes chart.SetPlotArea( 10, 40, 60, 30 )'( 10, 50, 60, 30 ) <- % Bars ' See Table Notes for BarMethodEffect & 3D_Depth values chart.AddBarLayer([BarMethodEffect],[3D_Depth])'Examples ->
' Add 3 element Bar series data "bar1" chart.AddBarSeries(AsSeries( bar1 ), 3 ) ' Add 3 element Bar series data "bar2" chart.AddBarSeries(AsSeries( bar2 ), 3 ) ' Create & Save an image of the chart with ' this file name. BackSlash Character is Required ' when using ResultsReportPath chart.Make(test.resultsReportPath+"\"+ vbar.png" )