SetPlotArea is used to control the positioning and size of the plotting area within the boundaries of the image.  Each of the four parameters provides the offset distance in pixels from the image edge to graph's plotting area around which space for the axis scales, labels, and legends is provided.  

 

Note:

Do not use SetPlotArea function with a NewPie chart because the plot area is not adjustable.

 

When trying to determine how many pixels are needed to make room for the characters and numbers in the scales and labels, there is no simple rule available.  It isn't available because different Font sizes and different fonts with a different styles require different pixel widths and heights of space to allow the label or scale information to be legible.  Pixel spacing is also influenced by the screen's pixel density settings.  For example, in this image its display size is 500 pixel wide by 300 pixel high.  Image was created created in Windows 7 64-Bit using a screen resolution of 1680 x 1050 pixels using a 32-bit color setting.  Screen density is 96 pixels per inch set in Landscape mode to fit a 21-inch monitor.

 

NewXY & SetPlotArea Dimension Locations

Scatter(500-300)_SetPlot(20-50-40-90) SetxAxisLabels & SetAxisTitles DIMS 1-11-2013 12-37-06 PM

 

Syntax:

chart.SetPlotArea( xLeftOffset, xRightOffset, yTopOffset, yBottomOffset )

 

Parameter:

Description:

xLeftOffset

The size of space to offset the graph's left side boundary plotting area from the image's left side edge.

xRightOffset

The pixel size positioning where the graph's right edge graphing boundary border area is placed from the right edge of the graphing image boundary.

yTopOffset

The pixel size positioning of the graph's top edge graphing boundary border area from the top edge of the graphing image boundary.

yBottomOffset

The pixel size positioning of the graph's bottom edge graphing boundary border area from the bottom edge of the graphing image boundary.

 

Example:

  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  '  SCATTER CHART - Script Example from the Scatter Charts Blox
  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  '  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, 90 )  <-- Reference Chart Diagram Details Above

 
  '   Use a BPV stepped string series to send date labels to X-Axis
  chart.SetxAxisLabels( AsSeries( LabelSeries), iRandomRange)
  '  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, 7, 6 )
  '  Create & Save this new chart as a file.
  '  Always add a backSlash Character after "resultsReportPath"
  chart.Make( test.resultsReportPath + "\" + "Scatter.png" )

Returns:

See image at top of this topic.

 

Links:

AddScatter, AsSeries, Make, NewXY, SetxAxisLabels, SetAxisTitles

See Also:

Chart

 


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


Topic ID#: 549

 

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