Class QuadrantPlot
java.lang.Object
org.eclnt.jsfserver.util.quadrantplot.QuadrantPlot
-
Constructor Summary
ConstructorDescriptionDefault constructor - automatically defined a width and height of 10 cm * 10 cm -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlotData
(double x, double y, String text, double size, String color) Output text in the plot area.
The number before the dezimal point is the quadrant index, the number after is the location in the quadrant.void
addPlotData
(double x, double y, String text, double size, String color, String id) void
addQuadrantInfo
(int x, int y, String color, String id) Add the info for one quadrant.void
Internally resets the data to a cleared status.long
computeOutputWidth
(int height) Calculate the width for the height, so that the quadrant output is quadratic.protected void
createSVGChart
(StringBuffer chartData) final long
getCi()
Internal usage only.getSvg()
Return the SVG string of the draw area.void
printFrameAround
(boolean printFrame) Print a frame araound the plot or not.
Default is print the frame.void
rotateXAxisScaleText
(double degrees, double height) Rotate the x axis scale textes.void
setBackgroundColor
(String color) Set the background color of the hole plot area.void
setLeftYAxisDistance
(double width) Additional space at the left side of the plot.void
setQuadrantplotprop
(String value) Internally used.void
setScaleLineColor
(String color) Set the color of the scale lines.void
setSelectedID
(String selectedID) void
setSelectionColor
(String selectionColor) When usingsetSelectedID(String)
then the area of the corresponding id will be marked by drawing a border with a certain color.void
setSelectionStrokeWidth
(int selectionStrokeWidth) When usingsetSelectedID(String)
then the area of the corresponding id will be marked by drawing a border with a certain color.void
Internally used.
For change or clear the selection use the method setSelectedID.void
setSVGOutputWidth
(int height) Set the height for the SVG output.void
Set the quadrant text for the x axis.void
Set the text for the x axis with the color and the font size.
All array's must have the same lenght.void
setXAxisDescription
(String description, String color, double fontSize, double height) Sets the description for the horizontal axis.void
Set the quadrant text for the y axis.void
Set the text for the y axis with the color and the font size.
All array's must have the same lenght.void
setYAxisDescription
(String description, String color, double fontSize, double width) Sets the description for the vertical axis.
-
Constructor Details
-
QuadrantPlot
public QuadrantPlot()Default constructor - automatically defined a width and height of 10 cm * 10 cm
-
-
Method Details
-
clearDrawAreaData
public void clearDrawAreaData()Internally resets the data to a cleared status. -
setXAxisDescription
Sets the description for the horizontal axis. This text is drawn under the chart.- Parameters:
description
- Text for the output under the chart, e. g. "Year 2000".color
- Color for the text. Either #RRGGBB (e.g. #FF0000 for red) or valid HTML color name ("red").fontSize
- The relative font size of the description, from 8 to 24. The default value is 12.height
- The gap under the x axis for the description. For fontSize 12, the height should be 200.
-
setXAxis
Set the quadrant text for the x axis.
The color is 'black' and the font size is '12'.- Parameters:
outputXAxis
- All text for the x axis.
-
setXAxis
Set the text for the x axis with the color and the font size.
All array's must have the same lenght.- Parameters:
outputXAxis
- All text for the x axis.size
- The size for each text.color
- The color for each text.
-
setYAxisDescription
Sets the description for the vertical axis. This text is drawn aside the chart.- Parameters:
description
- Text for the output beside the chart, e. g. "budget".color
- Color for the text. Either #RRGGBB (e.g. #FF0000 for red) or valid HTML color name ("red").fontSize
- The relative font size of the description, from 8 to 24. The default value is 12.width
- The gap on the left side of the x axis for the description. For fontSize 12, the width should be 200.
-
setYAxis
Set the quadrant text for the y axis.
The color is 'black' and the font size is '12'.- Parameters:
outputYAxis
- All text for the y axis.
-
setYAxis
Set the text for the y axis with the color and the font size.
All array's must have the same lenght.- Parameters:
outputYAxis
- All text for the y axis.size
- The size for each text.color
- The color for each text.
-
addQuadrantInfo
Add the info for one quadrant. The quadrants are placed from left bottom to right top.- Parameters:
x
- X axis index form 0 to the size of the x axis quadrant count minus 1.y
- Y axis index form 0 to the size of the y axis quadrant count minus 1.color
- Background color of the quadrant.id
- The id for the reactOnclick method.
-
addPlotData
Output text in the plot area.
The number before the dezimal point is the quadrant index, the number after is the location in the quadrant. The location is the left bottom point of the text.- Parameters:
x
- Quadrant and location at the x axis.y
- Quadrant and location in the y axis.text
- Output text.size
- Text size.color
- Text color.
-
addPlotData
-
rotateXAxisScaleText
public void rotateXAxisScaleText(double degrees, double height) Rotate the x axis scale textes. Also, you could reserve place for the text. The default rotation is 0 degrees.- Parameters:
degrees
- Rotation of the text between -90 and +90 degrees.height
- Additinal place for the rotated x axis texts between the plot and the x axis description.
-
setLeftYAxisDistance
public void setLeftYAxisDistance(double width) Additional space at the left side of the plot. -
printFrameAround
public void printFrameAround(boolean printFrame) Print a frame araound the plot or not.
Default is print the frame. -
setScaleLineColor
Set the color of the scale lines. Default color is black. -
setBackgroundColor
Set the background color of the hole plot area. Default color is white. -
setSelectedID
-
setSelectionColor
When usingsetSelectedID(String)
then the area of the corresponding id will be marked by drawing a border with a certain color. This selection color can be defined here. -
setSelectionStrokeWidth
public void setSelectionStrokeWidth(int selectionStrokeWidth) When usingsetSelectedID(String)
then the area of the corresponding id will be marked by drawing a border with a certain color. This width of this border can be defined here. -
getCi
public final long getCi()Internal usage only. Change index. -
setQuadrantplotprop
Internally used. -
setSelId
Internally used.
For change or clear the selection use the method setSelectedID. -
getSvg
Return the SVG string of the draw area. -
computeOutputWidth
public long computeOutputWidth(int height) Calculate the width for the height, so that the quadrant output is quadratic.- Parameters:
height
- The height of the output.- Returns:
- The widht for quadratic quadrant output.
-
setSVGOutputWidth
public void setSVGOutputWidth(int height) Set the height for the SVG output. Calculate the width, that the quadrants has a quadratric output.- Parameters:
height
- The height for the SVG output.
-
createSVGChart
-