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:

Two Group Scatter Chart - Example 1

Click to Enlarge; Click to Reduce.

 

 

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:

Two Group Scatter Chart - Example 2

Click to Enlarge; Click to Reduce.

 

Links:

AddScatter, AsSeries, Make, NewXY, resultsReportPath, SetPlotArea

See Also:

Chart, Chart Director Help Information

 


Edit Time: 9/7/2020 2:49:29 PM


Topic ID#: 533

 

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