org.silverpeas.chart
Class AbstractAxisChart<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE extends AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE>>

java.lang.Object
  extended by org.silverpeas.chart.AbstractChart<ITEM_TYPE>
      extended by org.silverpeas.chart.AbstractAxisChart<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE>
All Implemented Interfaces:
Chart<ITEM_TYPE>
Direct Known Subclasses:
PeriodChart

public abstract class AbstractAxisChart<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE extends AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE>>
extends AbstractChart<ITEM_TYPE>

Author:
Yohann Chastagnier

Constructor Summary
AbstractAxisChart()
           
 
Method Summary
protected
<T extends AbstractChart<ITEM_TYPE>>
T
add(ITEM_TYPE item)
          Adds an item into the list of chart items.
protected  void computeExtraDataAsJson(org.json.JSONObject jsonChart)
          Overriding this method if necessary.
 ITEM_TYPE forX(XAXIS_DATA_TYPE xValue)
          Creates or gets the item associated to the given x value.
 ChartAxis getAxisX()
          Gets the ChartAxis that represents the x axis.
 ChartAxis getAxisY()
          Gets the ChartAxis that represents the y axis.
protected  ITEM_TYPE getItemFrom(XAXIS_DATA_TYPE xValue)
          Gets the item associated to the given x value.
 
Methods inherited from class org.silverpeas.chart.AbstractChart
addExtra, asJson, getExtra, getItems, getTitle, withTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.silverpeas.chart.Chart
getType
 

Constructor Detail

AbstractAxisChart

public AbstractAxisChart()
Method Detail

getAxisX

public ChartAxis getAxisX()
Gets the ChartAxis that represents the x axis.

Returns:
the ChartAxis of x axis.

getAxisY

public ChartAxis getAxisY()
Gets the ChartAxis that represents the y axis.

Returns:
the ChartAxis of y axis.

computeExtraDataAsJson

protected void computeExtraDataAsJson(org.json.JSONObject jsonChart)
Description copied from class: AbstractChart
Overriding this method if necessary.

Overrides:
computeExtraDataAsJson in class AbstractChart<ITEM_TYPE extends AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE>>
Parameters:
jsonChart - the json object that represents the chart.

getItemFrom

protected ITEM_TYPE getItemFrom(XAXIS_DATA_TYPE xValue)
Gets the item associated to the given x value.

Parameters:
xValue - the x value.
Returns:
the associated item, null if none.

add

protected <T extends AbstractChart<ITEM_TYPE>> T add(ITEM_TYPE item)
Description copied from class: AbstractChart
Adds an item into the list of chart items.

Overrides:
add in class AbstractChart<ITEM_TYPE extends AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE>>
Parameters:
item - the chart item to add.
Returns:
the instance of the chart itself.

forX

public ITEM_TYPE forX(XAXIS_DATA_TYPE xValue)
Creates or gets the item associated to the given x value.

Parameters:
xValue - the x value.
Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.