public class Chart
extends Composite
Constructor | Description |
---|---|
Chart(Composite parent,
int style) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
dispose() |
|
void |
enableCompress(boolean enabled) |
Enables compressing series.
|
IAxisSet |
getAxisSet() |
Gets the set of axes.
|
Color |
getBackgroundInPlotArea() |
Gets the background color in plot area.
|
ILegend |
getLegend() |
Gets the legend.
|
int |
getOrientation() |
Gets the state of chart orientation.
|
Composite |
getPlotArea() |
Gets the plot area.
|
ISeriesSet |
getSeriesSet() |
Gets the set of series.
|
ITitle |
getTitle() |
Gets the chart title.
|
void |
handleEvent(Event event) |
|
boolean |
isCompressEnabled() |
Gets the state indicating if compressing series is enabled.
|
boolean |
isUpdateSuspended() |
Gets the state indicating if the update of chart appearance is suspended.
|
void |
redraw() |
|
void |
renderOffscreenImage(Image image) |
Renders off-screen image.
|
void |
save(java.lang.String filename,
int format) |
Saves to file with given format.
|
void |
setBackground(Color color) |
|
void |
setBackgroundInPlotArea(Color color) |
Sets the background color in plot area.
|
void |
setOrientation(int orientation) |
Sets the state of chart orientation.
|
void |
suspendUpdate(boolean suspend) |
Suspends the update of chart appearance.
|
void |
update() |
|
void |
updateLayout() |
Updates the layout of chart elements.
|
public Chart(Composite parent, int style)
parent
- the parent composite on which chart is placedstyle
- the style of widget to constructpublic ITitle getTitle()
public ILegend getLegend()
public IAxisSet getAxisSet()
public Composite getPlotArea()
public ISeriesSet getSeriesSet()
public void setBackground(Color color)
public Color getBackgroundInPlotArea()
public void setBackgroundInPlotArea(Color color)
color
- the background color in plot area. If null is given,
default background color will be set.java.lang.IllegalArgumentException
- if given color is disposedpublic void setOrientation(int orientation)
orientation
- the orientation which can be SWT.HORIZONTAL or SWT.VERTICALpublic int getOrientation()
public void enableCompress(boolean enabled)
enabled
- true if enabling compressing seriespublic boolean isCompressEnabled()
public void suspendUpdate(boolean suspend)
By default, when the chart model is changed (e.g. adding new series or changing chart properties), the chart appearance is updated accordingly.
However, when doing a lot of changes in the chart model at once, it is inefficient that the update happens many times unnecessarily. In this case, you may want to defer the update until completing whole model changes in order to have better performance.
For example, suppose there is a chart having a large number of series, the following example code disables the update during changing the model.
try { // suspend update chart.suspendUpdate(true); // do some changes for a large number of series for (ISeries series : chart.getSeriesSet().getSeries()) { series.enableStack(true); } } finally { // resume update chart.suspendUpdate(false); }Note that the update has to be resumed right after completing the model changes in order to avoid showing an incompletely updated chart.
suspend
- true to suspend the update of chart appearancepublic boolean isUpdateSuspended()
public void handleEvent(Event event)
public void updateLayout()
public void update()
public void dispose()
public void redraw()
public void save(java.lang.String filename, int format)
filename
- the file nameformat
- the format (SWT.IMAGE_*). The supported formats depend on OS.public void renderOffscreenImage(Image image)
image
- The image to render off-screen