Chart FX 7 for Java Server

com.softwarefx.chartfx.server.adornments
Class SolidBackground

java.lang.Object
  extended by com.softwarefx.chartfx.server.adornments.SolidBackground
All Implemented Interfaces:
IBackgroundAdornment

public class SolidBackground
extends Object
implements IBackgroundAdornment

Provides access to the SolidBackground object.

The SolidBackground object allows changing the color to the chart backgrounds.

The Color can be changed for either the Chart's background area, or the Chart's plot area, by using the Chart.setBackColor(java.awt.Color) and Chart.setPlotAreaColor(java.awt.Color) properties.

The following image shows an Azure BackColor:

Important Note : To set the solid background of a chart in your applications, you must reference the Adornments assembly in your project.


Constructor Summary
SolidBackground()
           
SolidBackground(Color color)
           
 
Method Summary
 void draw(Graphics2D g, Rectangle r, Color clrExternal)
          Draws a Chart FX SolidBackground on a selected device context.
 Color getColor()
          Gets the Color.
 void setColor(Color value)
          Sets the color of the background.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SolidBackground

public SolidBackground()

SolidBackground

public SolidBackground(Color color)
Method Detail

draw

public void draw(Graphics2D g,
                 Rectangle r,
                 Color clrExternal)

Draws a Chart FX SolidBackground on a selected device context.

Remarks:
  • This method allows you to draw a SolidBackground to a selected device context without ever assigning this background to a chart.

  • Parameters:
    g - A Graphics object associated with a specific device context.
    r - A Rectangle object specifying the desired position and size of the SolidBackground.
    clrExternal - The Color for the Background.
    See Also:
    setColor(java.awt.Color), SimpleBorder.draw(java.awt.Graphics2D, java.awt.Rectangle, java.awt.Color), GradientBackground.draw(java.awt.Graphics2D, java.awt.Rectangle, java.awt.Color), ImageBorder.draw(java.awt.Graphics2D, java.awt.Rectangle, java.awt.Color), ImageBackground.draw(java.awt.Graphics2D, java.awt.Rectangle, java.awt.Color), SimpleBorder, GradientBackground, ImageBorder, ImageBackground

    getColor

    public Color getColor()

    Gets the Color. For more detail see setColor(java.awt.Color).


    setColor

    public void setColor(Color value)

    Sets the color of the background.

    Remarks:
  • This property is used to set the color of the solid background in a chart. The Chart Chart.setBackground(com.softwarefx.chartfx.server.adornments.IBackgroundAdornment)is the area behind the ploting area, and is set to Yellow in the sample:

  • It can also be used to set the color of the ploting area (i.e., Chart.setPlotAreaBackground(com.softwarefx.chartfx.server.adornments.IBackgroundAdornment)):

  • The Chart's Chart.setBackColor(java.awt.Color) and Chart.setPlotAreaColor(java.awt.Color) are shorcuts to this property. The background color can be changed two ways:

    SolidBackground s = new SolidBackground();
    s.setColor(new java.awt.Color(238, 255, 255));
    chart1.setBackground(s);

    Or the following (with a solid background):

    chart1.setBackColor(new java.awt.Color(238, 255, 255));

  • See Also:
    Chart.setBackColor(java.awt.Color), Chart.setPlotAreaColor(java.awt.Color), draw(java.awt.Graphics2D, java.awt.Rectangle, java.awt.Color), Chart

    http://www.softwarefx.com

    2008 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.