Package org.zkoss.chart.model
Interface DialModel
-
- All Superinterfaces:
ChartsModel
- All Known Implementing Classes:
DefaultDialModel
public interface DialModel extends ChartsModel
A data model to be used with dial chart.- Author:
- jumperchen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
clear the model.double
getCapRadius()
Return the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.int
getFrameBgAlpha()
Get the background alpha of the dial frame (transparency, 0 ~ 255, opacue).String
getFrameBgColor()
Get the background color of the dial frame (in string as #RRGGBB).String
getFrameBgColor1()
Get the 1st background color of the dial frame (in string as #RRGGBB) for gradient starting color.String
getFrameBgColor2()
Get the 2nd background color of the dial frame (in string as #RRGGBB) for gradient ending color.int[]
getFrameBgRGB()
Get the background color of the dial frame in int array (0: red, 1: green, 2:blue).int[]
getFrameBgRGB1()
Get the 1st background color of the dial frame in int array (0: red, 1: green, 2:blue) for gradient starting color.int[]
getFrameBgRGB2()
Get the 2nd background color of the dial frame in int array (0: red, 1: green, 2:blue) for gradient ending color.String
getFrameFgColor()
Get the foreground color of the dial frame (in string as #RRGGBB).int[]
getFrameFgRGB()
Get the foreground color of the dial frame in int array (0: red, 1: green, 2:blue).String
getGradientDirection()
Returns the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.DialModelScale
getScale(int index)
Returns theDialModelScale
of the specified index.double
getValue(int index)
Get value of the scale per the specified index.int
indexOf(DialModelScale entry)
Return the index of the specified model entry.DialModelScale
newScale()
new an instance of scale in this DialModel.DialModelScale
newScale(double lowerBound, double upperBound, double startAngle, double extent, double majorTickInterval, int minorTickCount)
new an instance of scale in this DialModel.void
removeScale(DialModelScale scale)
Remove the specified DialModelScale from this DialModel.void
setCapRadius(double radius)
Sets the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.void
setFrameBgAlpha(int alpha)
Set the background alpha of the dial frame (transparency, 0 ~ 255).void
setFrameBgColor(String color)
Set the background color of the dial frame.void
setFrameBgColor1(String color)
Set the 1st background color of the dial frame (for gradient starting color).void
setFrameBgColor2(String color)
Set the 2nd background color of the dial frame (for gradient ending color).void
setFrameFgColor(String color)
Set the foreground color of the dial frame.void
setGradientDirection(String direction)
Set the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.void
setValue(int index, double value)
add or update the value of a specified scale index.int
size()
Returns the number ofDialModelScale
s.-
Methods inherited from interface org.zkoss.chart.model.ChartsModel
addChartsDataListener, removeChartsDataListener
-
-
-
-
Method Detail
-
size
int size()
Returns the number ofDialModelScale
s.
-
newScale
DialModelScale newScale()
new an instance of scale in this DialModel.- Returns:
- an instance of scale in this DialModel.
-
newScale
DialModelScale newScale(double lowerBound, double upperBound, double startAngle, double extent, double majorTickInterval, int minorTickCount)
new an instance of scale in this DialModel.- Parameters:
lowerBound
- lower bound of this scale.upperBound
- upper bound of this scale.startAngle
- starting angle in degree associated to the sclae's lower bound(0 degree point to east, counter-clockwise is positive).extent
- angles in degree extended from the starting angle (counter clockwise is positive).majorTickInterval
- the interval between major tick (in lower bound and upper bound).minorTickCount
- the number of minor ticks between major tick.
-
indexOf
int indexOf(DialModelScale entry)
Return the index of the specified model entry.- Parameters:
entry
- the DialModelScale- Returns:
- the index of the specified model entry.
-
getScale
DialModelScale getScale(int index)
Returns theDialModelScale
of the specified index.- Parameters:
index
- the index of the entry.- Returns:
- the DialModelScale.
-
removeScale
void removeScale(DialModelScale scale)
Remove the specified DialModelScale from this DialModel.- Parameters:
scale
-
-
getValue
double getValue(int index)
Get value of the scale per the specified index.- Parameters:
index
- the scale index.
-
setValue
void setValue(int index, double value)
add or update the value of a specified scale index.- Parameters:
index
- the index of the Scalevalue
- the value
-
clear
void clear()
clear the model.
-
setFrameBgAlpha
void setFrameBgAlpha(int alpha)
Set the background alpha of the dial frame (transparency, 0 ~ 255).- Parameters:
alpha
- the transparency of background color (0 ~ 255, default to 255 opaque).
-
getFrameBgAlpha
int getFrameBgAlpha()
Get the background alpha of the dial frame (transparency, 0 ~ 255, opacue).
-
setFrameBgColor
void setFrameBgColor(String color)
Set the background color of the dial frame.- Parameters:
color
- in #RRGGBB format (hexadecimal).
-
getFrameBgColor
String getFrameBgColor()
Get the background color of the dial frame (in string as #RRGGBB). null means default.
-
getFrameBgRGB
int[] getFrameBgRGB()
Get the background color of the dial frame in int array (0: red, 1: green, 2:blue). null means default.
-
setFrameFgColor
void setFrameFgColor(String color)
Set the foreground color of the dial frame.- Parameters:
color
- in #RRGGBB format (hexadecimal).
-
getFrameFgColor
String getFrameFgColor()
Get the foreground color of the dial frame (in string as #RRGGBB). null means default.
-
getFrameFgRGB
int[] getFrameFgRGB()
Get the foreground color of the dial frame in int array (0: red, 1: green, 2:blue). null means default.
-
setFrameBgColor1
void setFrameBgColor1(String color)
Set the 1st background color of the dial frame (for gradient starting color).- Parameters:
color
- in #RRGGBB format (hexadecimal).
-
getFrameBgColor1
String getFrameBgColor1()
Get the 1st background color of the dial frame (in string as #RRGGBB) for gradient starting color. null means use default.
-
getFrameBgRGB1
int[] getFrameBgRGB1()
Get the 1st background color of the dial frame in int array (0: red, 1: green, 2:blue) for gradient starting color. null means use default.
-
setFrameBgColor2
void setFrameBgColor2(String color)
Set the 2nd background color of the dial frame (for gradient ending color).- Parameters:
color
- in #RRGGBB format (hexadecimal).
-
getFrameBgColor2
String getFrameBgColor2()
Get the 2nd background color of the dial frame (in string as #RRGGBB) for gradient ending color. null means default.
-
getFrameBgRGB2
int[] getFrameBgRGB2()
Get the 2nd background color of the dial frame in int array (0: red, 1: green, 2:blue) for gradient ending color. null means default.
-
setGradientDirection
void setGradientDirection(String direction)
Set the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.
-
getGradientDirection
String getGradientDirection()
Returns the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.
-
setCapRadius
void setCapRadius(double radius)
Sets the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.- Parameters:
radius
- the radius percentage(0 ~ 1) of the meter's cap.
-
getCapRadius
double getCapRadius()
Return the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.- Returns:
- the radius percentage(0 ~ 1) of the meter's cap.
-
-