Package org.silverpeas.core.chart.period
Class PeriodChart
- java.lang.Object
-
- org.silverpeas.core.chart.AbstractChart<I>
-
- org.silverpeas.core.chart.AbstractAxisChart<Period,Number,PeriodChartItem>
-
- org.silverpeas.core.chart.period.PeriodChart
-
- All Implemented Interfaces:
Chart<PeriodChartItem>
public class PeriodChart extends AbstractAxisChart<Period,Number,PeriodChartItem>
- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
computeExtraDataAsJson(JSONCodec.JSONObject jsonChart)
Overriding this method if necessary.PeriodChartItem
forX(Date dateReference, PeriodType periodType)
Adds a value associated to a period.PeriodChartItem
forX(Period period)
Creates or gets the item associated to the given x value.static PeriodChart
fromTitle(String title)
Initializes a new chart with the specified title that will provides the data in order to display them on a temporal graphic.PeriodType
getDefaultPeriodType()
Gets the default period type.ChartType
getType()
Gets the type of chart.PeriodChart
setDefaultPeriodType(PeriodType defaultPeriodType)
Sets the default period type.static PeriodChart
withoutTitle()
Initializes a new chart without title that will provides the data in order to display them on a temporal graphic.-
Methods inherited from class org.silverpeas.core.chart.AbstractAxisChart
add, getAxisX, getAxisY, getItemFrom
-
-
-
-
Method Detail
-
fromTitle
public static PeriodChart fromTitle(String title)
Initializes a new chart with the specified title that will provides the data in order to display them on a temporal graphic.- Parameters:
title
- the main title of the chart.- Returns:
- a new instance of
PeriodChart
.
-
withoutTitle
public static PeriodChart withoutTitle()
Initializes a new chart without title that will provides the data in order to display them on a temporal graphic.- Returns:
- a new instance of
PeriodChart
.
-
getType
public ChartType getType()
Description copied from interface:Chart
Gets the type of chart.- Returns:
- the
ChartType
.
-
getDefaultPeriodType
public PeriodType getDefaultPeriodType()
Gets the default period type.- Returns:
- the default
PeriodType
.
-
setDefaultPeriodType
public PeriodChart setDefaultPeriodType(PeriodType defaultPeriodType)
Sets the default period type.- Parameters:
defaultPeriodType
- the default period type.- Returns:
- the instance of the chart itself.
-
computeExtraDataAsJson
protected void computeExtraDataAsJson(JSONCodec.JSONObject jsonChart)
Description copied from class:AbstractChart
Overriding this method if necessary.- Overrides:
computeExtraDataAsJson
in classAbstractAxisChart<Period,Number,PeriodChartItem>
- Parameters:
jsonChart
- the json object that represents the chart.
-
forX
public PeriodChartItem forX(Date dateReference, PeriodType periodType)
Adds a value associated to a period. ThePeriodType
of the period must not bePeriodType.unknown
.- Parameters:
dateReference
- a date of reference.periodType
- the period to represents.- Returns:
- the
PeriodChartItem
that represents the given values.
-
forX
public PeriodChartItem forX(Period period)
Description copied from class:AbstractAxisChart
Creates or gets the item associated to the given x value.- Overrides:
forX
in classAbstractAxisChart<Period,Number,PeriodChartItem>
- Parameters:
period
- the x value.- Returns:
-
-