M
- the data type used by this seriespublic class BarSeries<M> extends MultipleColorSeries<M>
BarSeries bar = new BarSeries(); bar.setYAxisPosition(Position.BOTTOM); bar.addYField(dataAccess.data1()); bar.addColor(new RGB(148,174,10)); chart.addSeries(bar);First the series is created with its associated data type. The y-axis position is set to tell the series the scale of the displayed axis. Otherwise the series will use its own internal scale. Next the value provider field is set, which provides the value of each bar. A color is also added to determine the color of the bars. Finally the series is added to the chart where it will be displayed.
Series.LabelPosition
Modifier and Type | Method and Description |
---|---|
void |
addYField(int index,
ValueProvider<? super M,? extends Number> yField)
Adds a data field for the y axis of the series.
|
void |
addYField(ValueProvider<? super M,? extends Number> yField)
Adds a data field for the y axis of the series.
|
void |
drawSeries()
Draws the series for the current chart.
|
double |
getBarGirth()
Calculates the girth of bars in the series.
|
Set<Integer> |
getExcluded()
Returns the fields that have been hidden from the series using
hide(int) . |
double |
getGroupGutter()
Returns the gutter between group bars.
|
double |
getGutter()
Returns the gutter between bars.
|
double[] |
getGutters()
Returns the axis insets of the series.
|
ArrayList<String> |
getLegendTitles()
Returns the list of titles used in the legend of the series.
|
Chart.Position |
getXAxisPosition()
Returns the x axis position of the series.
|
Chart.Position |
getYAxisPosition()
Returns the y axis position of the series.
|
ValueProvider<? super M,? extends Number> |
getYField(int index)
Returns the value provider for the y-axis of the series at the given index.
|
List<ValueProvider<? super M,? extends Number>> |
getYFields()
Returns the list of value providers for the y-axis of the series.
|
void |
hide(int yFieldIndex)
Hides the given y field index from the series.
|
void |
highlight(int yFieldIndex)
Highlights the series at the given series index.
|
void |
highlightAll(int index)
Highlights all of the items in the series.
|
boolean |
isColumn()
Returns whether or not the series is a column series.
|
boolean |
isStacked()
Returns whether or not the series is stacked.
|
ValueProvider<? super M,? extends Number> |
removeYField(int index)
Removes a data field for the y axis of the series.
|
boolean |
removeYField(ValueProvider<? super M,? extends Number> yField)
Removes a data field for the y axis of the series.
|
void |
setColumn(boolean column)
Sets whether or not the series is a column series.
|
void |
setGroupGutter(double groupGutter)
Sets the gutter between group bars.
|
void |
setGutter(double gutter)
Sets the gutter between bars.
|
void |
setLegendTitle(String title)
Sets the series title used in the legend.
|
void |
setLegendTitles(List<String> legendTitles)
Sets the list of labels used by the legend.
|
void |
setStacked(boolean stacked)
Sets whether or not the series is stacked.
|
void |
setXAxisPosition(Chart.Position xAxisPosition)
Sets the position of the x axis on the chart to be used by the series.
|
void |
setYAxisPosition(Chart.Position yAxisPosition)
Sets the position of the y axis on the chart to be used by the series.
|
void |
show(int yFieldIndex)
Shows the given y field index from the series.
|
void |
unHighlight(int yFieldIndex)
Removes highlighting from the given series index.
|
void |
unHighlightAll(int index)
UnHighlights all items in the series.
|
boolean |
visibleInLegend(int index)
Returns whether or not the given series index is visible in legend.
|
addColor, addColor, getColor, getColors, removeColor, removeColor, setColor
addSeriesHandler, addSeriesItemOutHandler, addSeriesItemOverHandler, addSeriesItemUpHandler, addSeriesSelectionHandler, calculateBBox, clear, getBBox, getChart, getHighlighter, getLabelConfig, getLegendNames, getRenderer, getShadowRenderer, getStroke, getStrokeWidth, getToolTip, getToolTipConfig, getValueProviderName, getXField, hideToolTip, highlightedState, isHighlighting, isShownInLegend, onMouseDown, onMouseMove, onMouseOut, onMouseUp, removeToolTip, setChart, setHighlighter, setHighlighting, setLabelConfig, setRenderer, setShadowRenderer, setShownInLegend, setStroke, setStrokeWidth, setToolTipConfig, setXField
public BarSeries()
Series
.public void addYField(int index, ValueProvider<? super M,? extends Number> yField)
index
- the index to have the yField insertedyField
- the value provider for the data on the y axispublic void addYField(ValueProvider<? super M,? extends Number> yField)
yField
- the value provider for the data on the y axispublic void drawSeries()
Series
drawSeries
in class Series<M>
public double getBarGirth()
public Set<Integer> getExcluded()
hide(int)
.public double getGroupGutter()
public double getGutter()
public double[] getGutters()
Series
getGutters
in class Series<M>
public ArrayList<String> getLegendTitles()
Series
getLegendTitles
in class Series<M>
public Chart.Position getXAxisPosition()
public Chart.Position getYAxisPosition()
public ValueProvider<? super M,? extends Number> getYField(int index)
index
- the index of the value providerpublic List<ValueProvider<? super M,? extends Number>> getYFields()
public void hide(int yFieldIndex)
Series
public void highlight(int yFieldIndex)
Series
public void highlightAll(int index)
Series
highlightAll
in class Series<M>
index
- the index of the seriespublic boolean isColumn()
public boolean isStacked()
public ValueProvider<? super M,? extends Number> removeYField(int index)
index
- the index to have the yField insertedpublic boolean removeYField(ValueProvider<? super M,? extends Number> yField)
yField
- the value provider for the data on the y axispublic void setColumn(boolean column)
column
- true if the series is a column seriespublic void setGroupGutter(double groupGutter)
groupGutter
- public void setGutter(double gutter)
gutter
- the gutter between barspublic void setLegendTitle(String title)
title
- the series title used in the legendpublic void setLegendTitles(List<String> legendTitles)
legendTitles
- the list of labelspublic void setStacked(boolean stacked)
stacked
- whether or not the series is stackedpublic void setXAxisPosition(Chart.Position xAxisPosition)
xAxisPosition
- the position of the x axis on the chart to be used by
the seriespublic void setYAxisPosition(Chart.Position yAxisPosition)
yAxisPosition
- the position of the y axis on the chart to be used by
the seriespublic void show(int yFieldIndex)
Series
public void unHighlight(int yFieldIndex)
Series
unHighlight
in class Series<M>
yFieldIndex
- the index to have its highlighting removedpublic void unHighlightAll(int index)
Series
unHighlightAll
in class Series<M>
index
- the index of the seriespublic boolean visibleInLegend(int index)
Series
visibleInLegend
in class Series<M>
index
- the series index to determine visibleCopyright © 2015. All rights reserved.