com.artfulbits.aiCharts.Base.ChartArea |
Represents chart area class. Chart area is an integral part of
ChartEngine
. It handles series and axes drawing logic. By design,
chart
passes recursive draw and layout calls to its
children. Parent ChartEngine
is able to host several areas
represented by areas collection
.
Legend
may represent series
from separate areas making possible complex layout design depending
on desired output (i.e. couple
pie
charts with legend
representing each of them).
// Retrieving defaultFollowing output is expected:ChartEngine
fromChartView
Chart chart = chartView.getChart(); // Adding 3 pie areas to the chart. for (int i = 0; i < 3; i++) { // Instantiating ChartArea. ChartArea area = new ChartArea(); // Setting the area name area.setName("area" + i); // Adding new area tochart
. chart.getAreas().add(area); // Instantiating ChartSeries. ChartSeries series = new ChartSeries("Series" + Integer.toString(i), ChartTypes.Pie); // Caching points collection. ChartPointCollection points = series.getPoints(); // Adding 10 points to series. for (int j = 0; j < 10; j++) { points.addXY(j, j * 100); } // Wiring series with area series.setArea(area.getName()); // Adding series tochart
. chart.getSeries().add(series); }
XML Attributes | |
---|---|
name | Defines area name |
grid | Defines grid background resource |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Initializes a new instance of ChartArea.
| |||||||||||
Initialize a new instance of ChartArea with specified Name.
| |||||||||||
Initializes a new instance of ChartArea class using passed axes.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets
ChartAxis collection. | |||||||||||
Gets the
Drawable that is used to draw background of area. | |||||||||||
Gets area bounding rectangle.
| |||||||||||
Returns current coordinate system.
| |||||||||||
Gets the default X axis.
| |||||||||||
Gets the default Y axis.
| |||||||||||
Gets the
Drawable that is used to draw background of area. | |||||||||||
Gets the name of this area.
| |||||||||||
Gets padding applied to this area.
| |||||||||||
Gets region occupied by series.
| |||||||||||
Sets bounds for this element.
| |||||||||||
Measures the element.
| |||||||||||
Refreshes the area.
| |||||||||||
Sets the
Drawable that is used to draw background of area grid. | |||||||||||
Sets bounds for this area.
| |||||||||||
Sets the default X axis.
| |||||||||||
Sets the default Y axis.
| |||||||||||
Sets the
Drawable that is used to draw background of area grid. | |||||||||||
Sets the name for area.
| |||||||||||
Sets padding for area.
| |||||||||||
Applies padding for all sides of this area.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Initializes a new instance of ChartArea. Sets default orientation for X and
Y axes. Series
should be added to area in order to be
represented.
Initialize a new instance of ChartArea with specified Name. Sets default
orientation for X and Y axes. Series
should be added to
area in order to be represented.
name | unique chart area name |
---|
Initializes a new instance of ChartArea class using passed axes.
xAxis | Vertical axis that represents default X axis for area. |
---|---|
yAxis | Horizontal axis that represents default Y axis for |
Gets area bounding rectangle.
Rect
representing current area bounds.Returns current coordinate system.
Gets the default X axis.
ChartAxis
used as default X axis.Gets the default Y axis.
ChartAxis
used as default X axis.Gets the name of this area.
String
representation of area' name.Gets padding applied to this area.
out | rectangle that represents left, top, right and bottom paddings applied on this area. |
---|
Gets region occupied by series.
RectF
representing area's series bounds.Sets bounds for this element.
rect | instance of Rect representing bounds for element.
|
---|
Measures the element.
inOutSize | available size to contains the element. This parameter have to be used to return the desired size of element. |
---|
Refreshes the area. Ensures compatible series visibility, recalculates axes range.
Sets bounds for this area.
rect | instance of region that should be occupied by this
area. |
---|
Sets the default X axis.
axis | instance of ChartAxis that should be used as default X
axis |
---|
Sets the default Y axis.
axis | instance of ChartAxis that should be used as default Y
axis |
---|
Sets the name for area.
name | String representation of desired name. |
---|
Sets padding for area. Area will re-layout itself after this call.
left | left-side padding. |
---|---|
top | top-side padding. |
right | right-side padding. |
bottom | bottom-side padding. |
Applies padding for all sides of this area. Area will re-layout itself after this call.
padding | additional padding for area measured in pixels. |
---|