public final class

ChartSeries

extends ChartPointAttributes
com.artfulbits.aiCharts.Base.ChartPointAttributes
   ↳ com.artfulbits.aiCharts.Base.ChartSeries

Class Overview

Represents chart series. Series is used to draw required chart type on area. Series is a part of area's series collection. Chart points collection for series can be added via getPoints() method. In order to be displayed, series should be added to chart's series collection:

 //Instantiate new instance of series.
 ChartSeries series = new ChartSeries("Series 1");
 //Add series to chart.
 chart.getSeries().add(series);
 
XML Attributes
name Defines series name
area Defines corresponding area name
legend Defines corresponding legend name
type Defines type
background Defines background resource
filter Defines whether color filter is enabled
marker Defines marker resource
markersize Defines marker size
showlabel Defines whether labels is shown
color Defines background color
border Defines border color
linewidth Defines line/border width
halign Defines labels horizontal alignment
valign Defines labels vertical alignment

Summary

Nested Classes
class ChartSeries.IconDrawable Drawable to represent series icon (legend, etc.) 
Public Constructors
ChartSeries(String name)
Initializes a new instance of ChartSereies class with specified name.
ChartSeries(String name, ChartType type)
Initializes a new instance of ChartSereies class with specified name and type.
ChartSeries(String name, Class<? extends ChartType> typeClass)
Initializes a new instance of ChartSereies class with specified name and type.
ChartSeries(Class<? extends ChartType> typeClass)
Initializes a new instance of ChartSereies class with specified type.
ChartSeries(ChartType type)
Initializes a new instance of ChartSereies class with specified type.
ChartSeries()
Initializes a new instance of ChartSereies class.
Public Methods
ChartAxis getActualXAxis()
Gets the actual X axis depending on currently assigned chart type.
ChartAxis getActualYAxis()
Gets the actual X axis depending on currently assigned chart type.
String getArea()
Gets the parent area name.
String getLegend()
Gets the name of legend that represents this series.
String getName()
Gets the name of this series.
ChartPointDeclaration getPointDeclaration()
Gets point declaration for series.
ChartPointCollection getPoints()
Gets the points collection that series represents.
List<ChartPoint> getPointsCache()
Gets sorted points array.
ChartType getType()
Gets the current type of series.
ChartAxis getXAxis()
Gets X axis for series.
ChartAxis getYAxis()
Gets Y axis for series.
boolean isRegionsEnabled()
Gets value indicating whether chart engine should track regions belonging to this series for future hit zones creation.
void setArea(String name)
Sets the name of area that is parent for this series.
void setLegend(String name)
Sets the name of legend that represents this series.
void setName(String name)
Sets the name for series.
void setRegionsEnabled(boolean enabled)
Sets value indicating whether chart engine should track regions belonging to this series for future hit zones creation.
void setType(ChartType type)
Sets the type that is represents the series.
void setType(Class<? extends ChartType> typeClass)
Sets the class of type that is represents the series.
void setXAxis(ChartAxis axis)
Sets X axis for series.
void setYAxis(ChartAxis axis)
Sets Y axis for series.
[Expand]
Inherited Methods
From class com.artfulbits.aiCharts.Base.ChartPointAttributes

Public Constructors

public ChartSeries (String name)

Initializes a new instance of ChartSereies class with specified name.

Parameters
name Name of series.

public ChartSeries (String name, ChartType type)

Initializes a new instance of ChartSereies class with specified name and type.

Parameters
name name of series.
type instance of ChartType class.

public ChartSeries (String name, Class<? extends ChartType> typeClass)

Initializes a new instance of ChartSereies class with specified name and type.

Parameters
name name of series.
typeClass class of chart type extended of ChartType.

public ChartSeries (Class<? extends ChartType> typeClass)

Initializes a new instance of ChartSereies class with specified type.

Parameters
typeClass class of chart type extended of ChartType

public ChartSeries (ChartType type)

Initializes a new instance of ChartSereies class with specified type.

Parameters
type instance of ChartType class.

public ChartSeries ()

Initializes a new instance of ChartSereies class.

Public Methods

public ChartAxis getActualXAxis ()

Gets the actual X axis depending on currently assigned chart type.

Returns
  • instance of ChartAxis that is currently actual for this series.

public ChartAxis getActualYAxis ()

Gets the actual X axis depending on currently assigned chart type.

Returns
  • instance of ChartAxis that is currently actual for this series.

public String getArea ()

Gets the parent area name.

Returns
  • name of parent area.

public String getLegend ()

Gets the name of legend that represents this series.

Returns
  • name of legend.

public String getName ()

Gets the name of this series. Name is used to identify series on ChartLegend

Returns
  • String representation of series' name.
See Also

public ChartPointDeclaration getPointDeclaration ()

Gets point declaration for series. Point declaration is actual for multiple Y value chart types.

Returns

public ChartPointCollection getPoints ()

Gets the points collection that series represents. Points collection is used to assign data to be represented*.

 // Adding double point to series1.
 series1.getPoints().addXY(1, 10);
 // Adding date point to series.
 series2.getPoints().addDate(trialTime, 10);
 // Adding XML element as source of points.
 series3.getPoints().setData(xmlElement, true);
 
*see samples along the SDK for more idea.

Returns
See Also
  • ChartPointCollection#setData(org.w3c.dom.Element, boolean, String, String...)
  • ChartPointCollection#addXY(double, double...)
  • ChartPointCollection#addDate(java.util.Date, double...)
  • ChartPoint

public List<ChartPoint> getPointsCache ()

Gets sorted points array.

Returns

public ChartType getType ()

Gets the current type of series.

Returns
  • instance of ChartType that is used to draw the series.
See Also

public ChartAxis getXAxis ()

Gets X axis for series.

Returns
  • instance of ChartAxis class currently representing X axis for series.

public ChartAxis getYAxis ()

Gets Y axis for series.

Returns
  • instance of ChartAxis class currently representing Y axis for series.

public boolean isRegionsEnabled ()

Gets value indicating whether chart engine should track regions belonging to this series for future hit zones creation.

Returns
  • true

public void setArea (String name)

Sets the name of area that is parent for this series. This is automatically removes previously assigned area and adds it to a new one. Series with the same area name will drawn together on area, only if the corresponding chart types are compatible.

Parameters
name String representation of area's name.

public void setLegend (String name)

Sets the name of legend that represents this series.

Parameters
name String representation of legend's name.

public void setName (String name)

Sets the name for series. Name is used to identify series on ChartLegend

Parameters
name String representation of desired name.

public void setRegionsEnabled (boolean enabled)

Sets value indicating whether chart engine should track regions belonging to this series for future hit zones creation.

public void setType (ChartType type)

Sets the type that is represents the series.

Parameters
type instance of ChartType class.

public void setType (Class<? extends ChartType> typeClass)

Sets the class of type that is represents the series.

Parameters
typeClass class of ChartType.

public void setXAxis (ChartAxis axis)

Sets X axis for series.

Parameters
axis instance of ChartAxis.

public void setYAxis (ChartAxis axis)

Sets Y axis for series.

Parameters
axis instance of ChartAxis.