org.hackystat.projectbrowser.page.projectportfolio.detailspanel.chart
Class MiniBarChart

java.lang.Object
  extended by org.hackystat.projectbrowser.page.projectportfolio.detailspanel.chart.MiniBarChart
All Implemented Interfaces:
java.io.Serializable

public class MiniBarChart
extends java.lang.Object
implements java.io.Serializable

A mini bar chart. Use GoogleChart to generate the chart.

Author:
Shaoxuan Zhang
See Also:
Serialized Form

Field Summary
static int BAR_WIDTH
          The width of a bar.
static int CHART_HEIGHT
          The height of the chart.
protected  java.lang.String granularity
          The granularity of the data.
static int MAX_WIDTH
          The max width of the chart.
protected  java.util.List<java.lang.Double> streamData
          The stream of this chart.
protected  java.util.List<java.util.List<java.lang.Double>> streams
          The list of original streams.
 
Constructor Summary
MiniBarChart(java.util.List<org.hackystat.telemetry.service.resource.chart.jaxb.TelemetryStream> streams, PortfolioMeasureConfiguration configuration, java.lang.String granularity)
           
 
Method Summary
 java.lang.String getChartColor()
           
 PortfolioMeasureConfiguration getConfiguration()
           
 java.lang.String getImageUrl()
           
 int getLastValidIndex()
           
 double getLatestValue()
           
static java.util.List<java.lang.Double> getStreamData(org.hackystat.telemetry.service.resource.chart.jaxb.TelemetryStream stream)
          Return a List of Double from the given telemetry stream.
 org.apache.wicket.PageParameters getTelemetryPageParameters()
           
 java.lang.String getValueColor()
          Return the color for the latest value.
 void setTelemetryPageParameters(org.apache.wicket.PageParameters telemetryPageParameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

streamData

protected java.util.List<java.lang.Double> streamData
The stream of this chart.


streams

protected java.util.List<java.util.List<java.lang.Double>> streams
The list of original streams.


granularity

protected java.lang.String granularity
The granularity of the data.


BAR_WIDTH

public static final int BAR_WIDTH
The width of a bar.

See Also:
Constant Field Values

MAX_WIDTH

public static final int MAX_WIDTH
The max width of the chart.

See Also:
Constant Field Values

CHART_HEIGHT

public static final int CHART_HEIGHT
The height of the chart.

See Also:
Constant Field Values
Constructor Detail

MiniBarChart

public MiniBarChart(java.util.List<org.hackystat.telemetry.service.resource.chart.jaxb.TelemetryStream> streams,
                    PortfolioMeasureConfiguration configuration,
                    java.lang.String granularity)
Parameters:
streams - The stream of this chart.
configuration - The configuration of this chart.
granularity - The granularity of the data.
Method Detail

getStreamData

public static final java.util.List<java.lang.Double> getStreamData(org.hackystat.telemetry.service.resource.chart.jaxb.TelemetryStream stream)
Return a List of Double from the given telemetry stream.

Parameters:
stream - a TelemetryStream
Returns:
the list of data of this stream

getImageUrl

public java.lang.String getImageUrl()
Returns:
a String URL that represents this chart.

getChartColor

public java.lang.String getChartColor()
Returns:
the color

getLatestValue

public double getLatestValue()
Returns:
the latestValue

getValueColor

public java.lang.String getValueColor()
Return the color for the latest value.

Returns:
the color

setTelemetryPageParameters

public void setTelemetryPageParameters(org.apache.wicket.PageParameters telemetryPageParameters)
Parameters:
telemetryPageParameters - the telemetryPageParameters to set

getTelemetryPageParameters

public org.apache.wicket.PageParameters getTelemetryPageParameters()
Returns:
the telemetryPageParameters

getConfiguration

public PortfolioMeasureConfiguration getConfiguration()
Returns:
the configuration

getLastValidIndex

public int getLastValidIndex()
Returns:
the lastValidIndex