public class nUIBarChart extends nUITwoAxisChart
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_BAR_GROUP_SPACING
Default spacing to apply between groups in a grouped bar chart
(expressed as a fraction of the space available for a full bar)
|
static float |
DEFAULT_BAR_SIZING
Default size of a bar for non-grouped
bar charts.
|
static float |
DEFAULT_GROUPED_BAR_SIZING
Default size of a bar for grouped bar charts.
|
DEFAULT_POINT_MARKER_SIZE, NUM_POINT_MARKERS, POINT_MARKER_BLOCK, POINT_MARKER_CIRCLE, POINT_MARKER_CROSS, POINT_MARKER_DIAMOND, POINT_MARKER_DOT, POINT_MARKER_LINE, POINT_MARKER_NONE, POINT_MARKER_PLUS, POINT_MARKER_SQUARE, POINT_MARKER_TRIANGLE, STACK_ABSOLUTE, STACK_ACCUMULATE
DEFAULT_BORDER_THICKNESS, NUM_RENDER_STYLES, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, RENDER_STYLE_FLAT, RENDER_STYLE_GRADIENT
Y_IDENTIFIER_PREV_BOTTOM
COLOR_BACKGROUND_NORMAL, COLOR_BLACK, COLOR_FOREGROUND_DARK, COLOR_FOREGROUND_LIGHT, COLOR_FOREGROUND_NORMAL, COLOR_TRANSPARENT, COLOR_WHITE, DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONS
event_listener, event_listener_exclusive, first_child, last_child, next_sibling, nuiid, parent, prev_sibling, unlink_children_on_removal_from_parent
Constructor and Description |
---|
nUIBarChart(int nuiid,
float[] data)
Chart constructor using defaults.
|
nUIBarChart(int nuiid,
float[][] data)
Takes an multi-dimensional array of numbers and display them
using a vertical bar graph.
|
nUIBarChart(int nuiid,
float[][] data,
int stack)
Chart constructor for a default stacked chart with
accumulated values.
|
nUIBarChart(int nuiid,
float[] data,
int stride)
Chart constructor for a default stacked chart with
accumulated values.
|
nUIBarChart(int nuiid,
float[] data,
int stride,
int stack)
Chart constructor for a stacked chart, but with the option of
absolute or accumulated values for each bar.
|
Modifier and Type | Method and Description |
---|---|
int |
getBarGrouping()
Gets the number of bars in a group.
|
float |
getBarGroupSpacing()
Gets the current bar group spacing value.
|
float |
getBarSizing()
Returns the current bar sizing value.
|
int |
getDefaultNumColors()
Gets the default number of colours that would be used to render this chart.
|
void |
renderImage()
Render the chart data, creating the
image for
the nUIImageElement |
void |
setBarGrouping(int bar_grouping)
Bars in a chart can be grouped together so that the there's
a different spacing gap between the groups.
|
void |
setBarGroupSpacing(float bar_group_spacing)
Similar to the bar sizing value, the bar group spacing value
is a fraction (> 0.0) of a standard bar's maximum size
that is used as the spacer between groups of bars.
|
void |
setBarSizing(float bar_sizing)
Sets the spacing of the bars within the space available for
each bar.
|
void |
setDefaults()
Sets the defaults for this chart type.
|
getAxes, getAxisColor, getAxisLabelCentering, getAxisLineThickness, getDataPointMarkerSize, getDataPointMarkerSizes, getDataPointMarkerType, getDataPointMarkerTypes, getHorizontalAxis, getMajorGridlineColor, getMajorGridlineThickness, getMinorGridlineColor, getMinorGridlineThickness, getOrientation, getPointMarkerSize, getPointMarkerType, getVerticalAxis, isStacked, renderDataLabels, setAxes, setAxisColor, setAxisLabelCentering, setAxisLineThickness, setDataPointMarkerSizes, setDataPointMarkerTypes, setMajorGridlineColor, setMajorGridlineThickness, setMinorGridlineColor, setMinorGridlineThickness, setOrientation, setPointMarkerSize, setPointMarkerType, setStackType
clearChartBodyPadding, getAxisLabelTextColor, getBackgroundColor, getBestGuessScale, getBorderColor, getBorderThickness, getData, getDataColor, getDataColors, getHeight, getImage, getNumColors, getOutlineColor, getOutlineThickness, getTickLabelTextColor, getWidth, setAxisLabelTextColor, setBackgroundColor, setBestGuessScale, setBorderColor, setBorderThickness, setChartBodyPadding, setChartBodyPadding, setData, setData, setData, setDataColors, setHeight, setImage, setOutlineColor, setOutlineThickness, setRenderStyle, setSize, setTickLabelTextColor, setWidth, suggestLineThickness
getAlign, getInnerWidth, getInnerX, setAlign
getY, insertAt
getBackgroundDrawable, getBgcolor, getBottom, getFocus, getFocusable, getGesturable, getInnerHeight, getInnerY, getLeft, getMaxChildX, getMaxChildY, getRight, getScreenInnerX, getScreenInnerY, getScreenX, getScreenY, getTop, getTopLevelParentView, getTopLevelParentWindow, getTriggerable, getX, insertAtInternal, isEnabled, onRemoved, remove, setBackgroundDrawable, setBgcolor, setBottom, setChildFocus, setEnabled, setFocus, setFocusable, setGesturable, setInnerHeight, setInnerWidth, setInnerX, setInnerY, setLeft, setRight, setTop, setTriggerable, setX, setY
add, addEventListener, childElementAt, childIndexOf, getTag, insertAfter, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setTag
public static final float DEFAULT_BAR_SIZING
public static final float DEFAULT_GROUPED_BAR_SIZING
public static final float DEFAULT_BAR_GROUP_SPACING
public nUIBarChart(int nuiid, float[] data) throws java.lang.IllegalArgumentException
nuiid
- Unique Native UI ID (or -1 if unidentified)data
- The data used to render this chartjava.lang.IllegalArgumentException
public nUIBarChart(int nuiid, float[][] data) throws java.lang.IllegalArgumentException
{{1,2}, {3,4}, {5,6}}
will produce two bars, each
with three literal values represented.nuiid
- Unique Native UI ID (or -1 if unidentified)data
- The data used to render this chartjava.lang.IllegalArgumentException
public nUIBarChart(int nuiid, float[] data, int stride) throws java.lang.IllegalArgumentException
stride
value for the data array.nuiid
- Unique Native UI ID (or -1 if unidentified)data
- The data used to render this chartstride
- The number of data points for each bar
elementjava.lang.IllegalArgumentException
public nUIBarChart(int nuiid, float[] data, int stride, int stack) throws java.lang.IllegalArgumentException
stride
value for the
data array.nuiid
- Unique Native UI ID (or -1 if unidentified)data
- The data used to render this chartstride
- The number of data points for each bar
elementstack
- Value of either
nUITwoAxisChart.STACK_ACCUMULATE (values are added) or
nUITwoAxisChart.STACK_ABSOLUTE (values are literal) to control
the interpretation of the valuesjava.lang.IllegalArgumentException
public nUIBarChart(int nuiid, float[][] data, int stack) throws java.lang.IllegalArgumentException
stride
value for the data array.nuiid
- Unique Native UI ID (or -1 if unidentified)data
- The data used to render this chartstack
- Value of either
nUITwoAxisChart.STACK_ACCUMULATE (values are added) or
nUITwoAxisChart.STACK_ABSOLUTE (values are literal) to control
the interpretation of the valuesjava.lang.IllegalArgumentException
public void setDefaults()
setDefaults
in class nUITwoAxisChart
public void setBarSizing(float bar_sizing)
bar_sizing
- float parameter between 0.0 and 1.0 as a fraction
of the bar widthpublic float getBarSizing()
public void setBarGrouping(int bar_grouping)
bar_grouping
- number of bars that will be grouped
together. Anything less than 2 is
considered no grouping.public int getBarGrouping()
public void setBarGroupSpacing(float bar_group_spacing)
bar_group_spacing
- fractional value >= 0. A value of 0
means no gaps between groups.public float getBarGroupSpacing()
public int getDefaultNumColors()
nUIChartImage
getDefaultNumColors
in class nUIChartImage
public void renderImage()
image
for
the nUIImageElement