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 voidclear()clear the model.doublegetCapRadius()Return the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.intgetFrameBgAlpha()Get the background alpha of the dial frame (transparency, 0 ~ 255, opacue).StringgetFrameBgColor()Get the background color of the dial frame (in string as #RRGGBB).StringgetFrameBgColor1()Get the 1st background color of the dial frame (in string as #RRGGBB) for gradient starting color.StringgetFrameBgColor2()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.StringgetFrameFgColor()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).StringgetGradientDirection()Returns the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.DialModelScalegetScale(int index)Returns theDialModelScaleof the specified index.doublegetValue(int index)Get value of the scale per the specified index.intindexOf(DialModelScale entry)Return the index of the specified model entry.DialModelScalenewScale()new an instance of scale in this DialModel.DialModelScalenewScale(double lowerBound, double upperBound, double startAngle, double extent, double majorTickInterval, int minorTickCount)new an instance of scale in this DialModel.voidremoveScale(DialModelScale scale)Remove the specified DialModelScale from this DialModel.voidsetCapRadius(double radius)Sets the radius percentage(0 ~ 1) of the meter's cap; default to 0.07.voidsetFrameBgAlpha(int alpha)Set the background alpha of the dial frame (transparency, 0 ~ 255).voidsetFrameBgColor(String color)Set the background color of the dial frame.voidsetFrameBgColor1(String color)Set the 1st background color of the dial frame (for gradient starting color).voidsetFrameBgColor2(String color)Set the 2nd background color of the dial frame (for gradient ending color).voidsetFrameFgColor(String color)Set the foreground color of the dial frame.voidsetGradientDirection(String direction)Set the Frame background gradient color direction (from bgColor1 to bgColor2); center_horizontal, center_vertical, horizontal, vertical.voidsetValue(int index, double value)add or update the value of a specified scale index.intsize()Returns the number ofDialModelScales.-
Methods inherited from interface org.zkoss.chart.model.ChartsModel
addChartsDataListener, removeChartsDataListener
-
-
-
-
Method Detail
-
size
int size()
Returns the number ofDialModelScales.
-
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 theDialModelScaleof 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.
-
-