SetAxisTitles function adds two text axis titles to X & Y scale locations.

 

Note:

Plotting area in this image used the SetPlotArea function to control how much space around the image would be provided for scale values and the addition of the axis titles.  Axis titles are displayed without a problem, but if the x-axis scale values are converted to dates, the additional space needed by the data labels might cause some or all of the the x-axis title name to be obscured.  When that happens, increase the plot area pixel size of the last value parameter on the right.  Rotating scales using the "Vertical" option will also require plot area size location changes.

 

Syntax:

chart.SetAxisTitles( xAxisLabel, yAxisLabel )

 

Parameter:

Description:

xAxisLabel

The string - Name of x-Axis title.

yAxisLabel

The string - Name of y-Axis title.

 

Example - 1:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  SCATTER CHART - x-Axis At Chart Bottom - Axis Not Rotated
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Establish Scatter Chart image size
iChartWidth = 500   '  X-Axis Width
iChartHeight = 300   '  Y-Axis Height
'  Create a image
chart.NewXY( "Scatter", iChartWidth, iChartHeight )

'  Size the Scatter Dot Ploting area
chart.SetPlotArea( 20, 50, 40, 55 )  

'  Place the X-Axis scale label "Temperature" in the left corner.
'  Place the Y-Axis label "Humidity" in the lower right corner.
chart.SetAxisTitles( "Temperature", "Humidity" )  
'  Place the series of 100 dots positioned at element coordinates
'  x & y using the BPV "Randomx" element values.
chart.AddScatter( AsSeries( randomx ), AsSeries( randomy ), iNumber, 7, 6 )
'  Place the series of 100 dots positioned at element coordinates
'  x & y using the BPV "House2x" element values.
chart.AddScatter( AsSeries( house2x ), AsSeries( house2y ), iNumber, 3, 10 )
'  Create & Save this new chart as a file.
'  Always add a backSlash Character after "resultsReportPath"
chart.Make( test.resultsReportPath + "\" + "Scatter.png" )

Returns - 1:

Standard x-Axis position places x-Axis below x-Scale and y-Axis scale is placed along y-Scale on right side of plotted area.

Standard x-Axis position places x-Axis below x-Scale and y-Axis scale is placed along y-Scale on right side of plotted area.

 

 

Example - 2:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  SCATTER CHART - x-Axis At Chart Left Size - Axis Rotated
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Establish Scatter Chart image size
iChartWidth = 500   '  X-Axis Width
iChartHeight = 300   '  Y-Axis Height
'  Create a image
chart.NewXY( "Scatter", iChartWidth, iChartHeight, "Vertical" )
'  Size the Scatter Dot Ploting area
chart.SetPlotArea( 50, 20, 50, 40 )
'  Place the X-Axis scale label "Temperature" in the left corner.
'  Place the Y-Axis label "Humidity" in the lower right corner.
chart.SetAxisTitles( "Temperature", "Humidity" )  
'  Place the series of 100 dots positioned at element coordinates
'  x & y using the BPV "Randomx" element values.
chart.AddScatter( AsSeries( randomx ), AsSeries( randomy ), iNumber, 7, 6 )
'  Place the series of 100 dots positioned at element coordinates
'  x & y using the BPV "House2x" element values.
chart.AddScatter( AsSeries( house2x ), AsSeries( house2y ), iNumber, 3, 10 )
'  Create & Save this new chart as a file.
'  Always add a backSlash Character after "resultsReportPath"
chart.Make( test.resultsReportPath + "\" + "Scatter.png" )

 

Returns - 2:

Code for this image is using the "Vertical" option with the NewXY function to rotate the x-Axis scale 90-degrees to the right.  When axis locations are rotated, x-axis label is placed along left side of image, and y-axis label is placed below y-axis scale.

Code for this image is using the "Vertical" option with the NewXY function to rotate the x-Axis scale 90-degrees to the right.  When axis locations are rotated, x-axis label is placed along left side of image, and y-axis label is placed below y-axis scale.

 

Links:

AddScatter, AsSeries, Make, NewXY, resultsReportPath, SetPlotArea

See Also:

Chart

 


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


Topic ID#: 533

 

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