public class SeriesLabel extends Object implements ISeriesLabel
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.swt.graphics.Color |
color
the series label color
|
protected org.eclipse.swt.graphics.Font |
font
the series label font
|
Constructor and Description |
---|
SeriesLabel()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
draw(org.eclipse.swt.graphics.GC gc,
int h,
int v,
double ySeriesValue,
int seriesIndex,
int alignment)
Draws series label.
|
org.eclipse.swt.graphics.Font |
getFont()
Gets the label font.
|
org.eclipse.swt.graphics.Color |
getForeground()
Gets the label color.
|
String |
getFormat()
Gets the format for label.
|
String[] |
getFormats()
Gets the formats for all data points.
|
boolean |
isVisible()
Gets the label visibility state.
|
void |
setFont(org.eclipse.swt.graphics.Font font)
Sets the label font.
|
void |
setForeground(org.eclipse.swt.graphics.Color color)
Sets the label color.
|
void |
setFormat(String format)
Sets the decimal format
DecimalFormat or/plus plain string. |
void |
setFormats(String[] formats)
Sets the formats for all data points.
|
void |
setVisible(boolean visible)
Sets the label visibility state.
|
protected org.eclipse.swt.graphics.Font font
protected org.eclipse.swt.graphics.Color color
public String getFormat()
ISeriesLabel
getFormat
in interface ISeriesLabel
public void setFormat(String format)
ISeriesLabel
DecimalFormat
or/plus plain string.
If formats have been set with setFormats(String[]), the format set with this method will be ignored.
If null is given, default format "#.###########" will be set.
setFormat
in interface ISeriesLabel
format
- the formatpublic String[] getFormats()
ISeriesLabel
getFormats
in interface ISeriesLabel
public void setFormats(String[] formats)
ISeriesLabel
setFormats
in interface ISeriesLabel
formats
- the formatspublic org.eclipse.swt.graphics.Color getForeground()
ISeriesLabel
getForeground
in interface ISeriesLabel
public void setForeground(org.eclipse.swt.graphics.Color color)
ISeriesLabel
setForeground
in interface ISeriesLabel
color
- the label colorpublic org.eclipse.swt.graphics.Font getFont()
ISeriesLabel
getFont
in interface ISeriesLabel
public void setFont(org.eclipse.swt.graphics.Font font)
ISeriesLabel
setFont
in interface ISeriesLabel
font
- the label fontpublic boolean isVisible()
ISeriesLabel
isVisible
in interface ISeriesLabel
public void setVisible(boolean visible)
ISeriesLabel
setVisible
in interface ISeriesLabel
visible
- the label visibility stateprotected void draw(org.eclipse.swt.graphics.GC gc, int h, int v, double ySeriesValue, int seriesIndex, int alignment)
gc
- the GC objecth
- the horizontal coordinate to draw labelv
- the vertical coordinate to draw labelySeriesValue
- the Y series valueseriesIndex
- the series indexalignment
- the alignment of label position (SWT.CENTER or SWT.BOTTOM)Copyright © 2019. All rights reserved.