public abstract class BaseLabelRenderer extends PropertyManager implements ChartLabelRenderer
Modifier and Type | Field and Description |
---|---|
static int |
LABEL_COLOR_PROPERTY_KEY |
static int |
LABEL_FILL_COLOR_PROPERTY_KEY |
static int |
LABEL_STROKE_COLOR_PROPERTY_KEY |
Constructor and Description |
---|
BaseLabelRenderer(ChartSeries owner)
Creates a new instance of the
BaseLabelRenderer class used for rendering series labels. |
Modifier and Type | Method and Description |
---|---|
void |
applyPalette(ChartPalette palette)
Applies the passed palette to the current label renderer instance.
|
int |
getLabelFillColor()
Gets the label fill color.
|
Typeface |
getLabelFont()
Gets the labels
Typeface |
int |
getLabelFontStyle()
Gets the labels font style.
|
String |
getLabelFormat()
Gets the label format string.
|
float |
getLabelMargin()
Gets the margin of the labels.
|
float |
getLabelSize()
Gets the label size.
|
int |
getLabelStrokeColor()
Gets the color of the label stroke.
|
int |
getLabelTextColor()
Gets the labels color.
|
Function<Object,String> |
getLabelValueToStringConverter() |
void |
invalidatePalette()
Used to force apply the current palette.
|
void |
renderLabel(Canvas canvas,
ChartNode dataPoint)
|
void |
setLabelFillColor(int color)
Sets the label fill color.
|
void |
setLabelFont(Typeface value)
Sets the labels
Typeface . |
void |
setLabelFontStyle(int value)
Sets the labels font style.
|
void |
setLabelFormat(String format)
Sets the label format string.
|
void |
setLabelMargin(float offset)
Sets the margin of the labels.
|
void |
setLabelPadding(float left,
float top,
float right,
float bottom)
Sets the padding for the labels.
|
void |
setLabelSize(float value)
Sets the label size.
|
void |
setLabelStrokeColor(int color)
Sets the color of the label stroke.
|
void |
setLabelTextColor(int color)
Sets the labels color.
|
void |
setLabelValueToStringConverter(Function<Object,String> converter) |
getValue, resetPropertyValue, setValue, setValue
public static int LABEL_FILL_COLOR_PROPERTY_KEY
public static int LABEL_STROKE_COLOR_PROPERTY_KEY
public static int LABEL_COLOR_PROPERTY_KEY
public BaseLabelRenderer(ChartSeries owner)
BaseLabelRenderer
class used for rendering series labels.owner
- the chart series that will be owning the current renderer instance.public int getLabelTextColor()
ChartLabelRenderer
getLabelTextColor
in interface ChartLabelRenderer
public void setLabelTextColor(int color)
ChartLabelRenderer
setLabelTextColor
in interface ChartLabelRenderer
color
- The labels color.public Typeface getLabelFont()
ChartLabelRenderer
Typeface
getLabelFont
in interface ChartLabelRenderer
public void setLabelFont(Typeface value)
ChartLabelRenderer
Typeface
.setLabelFont
in interface ChartLabelRenderer
value
- The new labels typeface.public void setLabelPadding(float left, float top, float right, float bottom)
left
- the left padding.top
- the top padding.right
- the right padding.bottom
- the bottom padding.public int getLabelFontStyle()
ChartLabelRenderer
getLabelFontStyle
in interface ChartLabelRenderer
public void setLabelFontStyle(int value)
ChartLabelRenderer
setLabelFontStyle
in interface ChartLabelRenderer
value
- The new labels font style.public String getLabelFormat()
ChartLabelRenderer
getLabelFormat
in interface ChartLabelRenderer
public void setLabelFormat(String format)
ChartLabelRenderer
setLabelFormat
in interface ChartLabelRenderer
format
- The label format string. The format string is a standard Java format string.
For more information see the java formatter help page.public float getLabelMargin()
ChartLabelRenderer
getLabelMargin
in interface ChartLabelRenderer
public void setLabelMargin(float offset)
ChartLabelRenderer
setLabelMargin
in interface ChartLabelRenderer
offset
- The new labels margin.public float getLabelSize()
ChartLabelRenderer
getLabelSize
in interface ChartLabelRenderer
public void setLabelSize(float value)
ChartLabelRenderer
setLabelSize
in interface ChartLabelRenderer
value
- The label size.public int getLabelFillColor()
public void setLabelFillColor(int color)
color
- the new fill color.public int getLabelStrokeColor()
public void setLabelStrokeColor(int color)
color
- the new stroke color.public Function<Object,String> getLabelValueToStringConverter()
getLabelValueToStringConverter
in interface ChartLabelRenderer
public void setLabelValueToStringConverter(Function<Object,String> converter)
setLabelValueToStringConverter
in interface ChartLabelRenderer
public void applyPalette(ChartPalette palette)
palette
- the palette to be applied.public void invalidatePalette()
public void renderLabel(Canvas canvas, ChartNode dataPoint)
ChartLabelRenderer
renderLabel
in interface ChartLabelRenderer
canvas
- The canvas to draw on.dataPoint
- The ChartNode
that is related to the label. For a series it will be a DataPoint
. For an Axis
it will be an AxisTickModel
.