it.eng.spagobi.engines.chart.bo.charttypes.barcharts
Class SimpleBar

java.lang.Object
  extended by it.eng.spagobi.engines.chart.bo.ChartImpl
      extended by it.eng.spagobi.engines.chart.bo.charttypes.barcharts.BarCharts
          extended by it.eng.spagobi.engines.chart.bo.charttypes.barcharts.SimpleBar
All Implemented Interfaces:
IChart

public class SimpleBar
extends BarCharts

Author:
Giulio Gavardi giulio.gavardi@eng.it

Field Summary
static java.lang.String CHANGE_VIEW_HORIZONTAL
           
static java.lang.String CHANGE_VIEW_LABEL
           
static java.lang.String CHANGE_VIEW_LABEL1
           
static java.lang.String CHANGE_VIEW_LABEL2
           
static java.lang.String ORIENTATION
          Orientation of the chart: horizontal, vertical
 
Fields inherited from class it.eng.spagobi.engines.chart.bo.charttypes.barcharts.BarCharts
CATEGORY_LABEL, DYNAMIC_N_VISUALIZATION, ENABLE_TOOLTIPS, FILTER_CAT_GROUPS, FILTER_CATEGORIES, FILTER_SERIES, FILTER_SERIES_BUTTONS, MAXIMUM_BAR_WIDTH, N_CAT_VISUALIZATION, N_SER_VISUALIZATION, N_VISUALIZATION, RANGE_AXIS_LOCATION, RANGE_INTEGER_VALUES, SERIES_COLORS, SERIES_ORDER_COLORS, SHOW_VALUE_LABLES, VALUE_LABEL, VALUE_LABELS_POSITION
 
Fields inherited from class it.eng.spagobi.engines.chart.bo.ChartImpl
BARCHART, blockchart, BLOCKCHART, BOXCHART, bullet, CLUSTERCHART, color, COLOR_STYLE, COLORS_BACKGROUND, combined_category_bar, CONF, CONF_DATASET, confDataset, data, defaultLabelsStyle, DIAL_CHART, DIMENSION_HEIGHT, DIMENSION_WIDTH, filter, FONT_STYLE, height, isLovConfDefined, legend, LEGEND, LEGEND_POSITION, LEGEND_STYLE, legendPosition, linkablebar, linkablepie, locale, markerscatter, meter, multichart, name, NAME, NAME_STYLE, ORIENTATION_STYLE, orientationMultichart, overlaid_barline, overlaid_stacked_barline, parametersObject, PIECHART, POSITION_SLIDER, positionSlider, profile, SCATTERCHART, SERIES_LABELS, seriesLabelsMap, simplebar, simplebox, simplecluster, simpledial, simplepie, simplescatter, simpletimeblock, SIZE_STYLE, slider, SLIDER_START_FROM_END, sliderStartFromEnd, sparkline, speedometer, speedometerMultiValue, stacked_bar, stacked_bar_group, STYLE_LABELS_DEFAULT, STYLE_SUBTITLE, STYLE_TITLE, styleLegend, styleSubTitle, styleTitle, subName, subtype, TARGETCHART, thermomether, TITLE_DIMENSION, titleDimension, type, VIEW_FILTER, VIEW_SLIDER, width, winlose, XYCHART
 
Constructor Summary
SimpleBar()
           
 
Method Summary
 void configureChart(it.eng.spago.base.SourceBean content)
          Calculates chart value; public Dataset calculateValue(String cat, Map parameters) throws Exception { logger.debug("IN"); String res=DataSetAccessFunctions.getDataSetResult(profile, getData(),parameters); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); SourceBean sbRows=SourceBean.fromXMLString(res); List listAtts=sbRows.getAttributeAsList("ROW"); // run all categories (one for each row) categoriesNumber=0; for (Iterator iterator = listAtts.iterator(); iterator.hasNext();) { SourceBean category = (SourceBean) iterator.next(); List atts=category.getContainedAttributes(); HashMap series=new HashMap(); String catValue=""; String name=""; String value=""; //run all the attributes, to define series! for (Iterator iterator2 = atts.iterator(); iterator2.hasNext();) { SourceBeanAttribute object = (SourceBeanAttribute) iterator2.next(); name=new String(object.getKey()); value=new String((String)object.getValue()); if(name.equalsIgnoreCase("x"))catValue=value; else series.put(name, value); } for (Iterator iterator3 = series.keySet().iterator(); iterator3.hasNext();) { String nameS = (String) iterator3.next(); String valueS=(String)series.get(nameS); dataset.addValue(Double.valueOf(valueS).doubleValue(), nameS, catValue); categoriesNumber=categoriesNumber+1; } } logger.debug("OUT"); return dataset; }
 org.jfree.chart.JFreeChart createChart(DatasetMap datasets)
          This function creates the chart object.
 boolean getChangeViewParameter(java.lang.String changePar)
          Gets the change view parameter.
 java.lang.String getChangeViewParameterLabel(java.lang.String changePar, int i)
          Gets the change view parameter label.
 java.util.List getPossibleChangePars()
          Gets the possible change pars.
 boolean isChangeableView()
          Checks if is changeable view.
 boolean isHorizontalView()
          Checks if is horizontal view.
 void setChangeViewsParameter(java.lang.String changePar, boolean how)
          Sets the change views parameter.
 void setHorizontalView(boolean changeViewChecked)
          Sets the horizontal view.
 
Methods inherited from class it.eng.spagobi.engines.chart.bo.charttypes.barcharts.BarCharts
calculateValue, filterDataset, filterDatasetCatGroups, filterDatasetSeries, getCategories, getCategoriesNumber, getCategoryLabel, getCatGroupNames, getCatGroups, getConfParameters, getCurrentCatGroups, getCurrentSeries, getFilterStyle, getNumberCatVisualization, getNumberSerVisualization, getSeriesNames, getSeriesNumber, getSeriesOrder, getValueLabel, isDynamicNumberCatVisualization, isFilterCategories, isFilterCatGroups, isFilterSeries, isFilterSeriesButtons, putSeriesNumber, setCategoriesNumber, setCategoryLabel, setCatGroupNames, setCatGroups, setConfParameters, setCurrentCatGroups, setCurrentSeries, setDynamicNumberCatVisualization, setFilterCategories, setFilterCatGroups, setFilterSeries, setFilterSeriesButtons, setFilterStyle, setNumberCatVisualization, setNumberSerVisualization, setSeriesNames, setSeriesOrder, setValueLabel
 
Methods inherited from class it.eng.spagobi.engines.chart.bo.ChartImpl
createChart, drawLegend, getChangeViewLabel, getColor, getConfDataset, getData, getHeight, getLegendPosition, getLocale, getMultichart, getName, getOrientationMultichart, getParametersObject, getPositionSlider, getProfile, getSeriesLabels, getSubName, getSubtype, getTitleDimension, getType, getWidth, isFilter, isLegend, isLinkable, isLovConfDefined, isSlider, isSliderStartFromEnd, setChangeViewChecked, setColor, setConfDataset, setData, setFilter, setHeight, setLegend, setLegendPosition, setLocale, setLocalizedTitle, setLovConfDefined, setMultichart, setName, setOrientationMultichart, setParametersObject, setPositionSlider, setProfile, setSeriesLabels, setSlider, setSliderStartFromEnd, setStyleTitle, setSubName, setSubTitleParameter, setSubTitleParameter, setSubtype, setTitleDimension, setTitleParameter, setTitleParameter, setType, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHANGE_VIEW_HORIZONTAL

public static final java.lang.String CHANGE_VIEW_HORIZONTAL
See Also:
Constant Field Values

CHANGE_VIEW_LABEL

public static final java.lang.String CHANGE_VIEW_LABEL
See Also:
Constant Field Values

CHANGE_VIEW_LABEL1

public static final java.lang.String CHANGE_VIEW_LABEL1
See Also:
Constant Field Values

CHANGE_VIEW_LABEL2

public static final java.lang.String CHANGE_VIEW_LABEL2
See Also:
Constant Field Values

ORIENTATION

public static final java.lang.String ORIENTATION
Orientation of the chart: horizontal, vertical

See Also:
Constant Field Values
Constructor Detail

SimpleBar

public SimpleBar()
Method Detail

configureChart

public void configureChart(it.eng.spago.base.SourceBean content)
Description copied from class: BarCharts
Calculates chart value; public Dataset calculateValue(String cat, Map parameters) throws Exception { logger.debug("IN"); String res=DataSetAccessFunctions.getDataSetResult(profile, getData(),parameters); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); SourceBean sbRows=SourceBean.fromXMLString(res); List listAtts=sbRows.getAttributeAsList("ROW"); // run all categories (one for each row) categoriesNumber=0; for (Iterator iterator = listAtts.iterator(); iterator.hasNext();) { SourceBean category = (SourceBean) iterator.next(); List atts=category.getContainedAttributes(); HashMap series=new HashMap(); String catValue=""; String name=""; String value=""; //run all the attributes, to define series! for (Iterator iterator2 = atts.iterator(); iterator2.hasNext();) { SourceBeanAttribute object = (SourceBeanAttribute) iterator2.next(); name=new String(object.getKey()); value=new String((String)object.getValue()); if(name.equalsIgnoreCase("x"))catValue=value; else series.put(name, value); } for (Iterator iterator3 = series.keySet().iterator(); iterator3.hasNext();) { String nameS = (String) iterator3.next(); String valueS=(String)series.get(nameS); dataset.addValue(Double.valueOf(valueS).doubleValue(), nameS, catValue); categoriesNumber=categoriesNumber+1; } } logger.debug("OUT"); return dataset; }

Specified by:
configureChart in interface IChart
Overrides:
configureChart in class BarCharts
Parameters:
content - the content

createChart

public org.jfree.chart.JFreeChart createChart(DatasetMap datasets)
Description copied from class: ChartImpl
This function creates the chart object.

Specified by:
createChart in interface IChart
Overrides:
createChart in class BarCharts
Parameters:
datasets - the dataset
Returns:
the j free chart

isHorizontalView

public boolean isHorizontalView()
Checks if is horizontal view.

Returns:
true, if is horizontal view

setHorizontalView

public void setHorizontalView(boolean changeViewChecked)
Sets the horizontal view.

Parameters:
changeViewChecked - the new horizontal view

isChangeableView

public boolean isChangeableView()
Description copied from interface: IChart
Checks if is changeable view.

Specified by:
isChangeableView in interface IChart
Overrides:
isChangeableView in class ChartImpl
Returns:
true, if is changeable view

getPossibleChangePars

public java.util.List getPossibleChangePars()
Description copied from interface: IChart
Gets the possible change pars.

Specified by:
getPossibleChangePars in interface IChart
Overrides:
getPossibleChangePars in class ChartImpl
Returns:
the possible change pars

setChangeViewsParameter

public void setChangeViewsParameter(java.lang.String changePar,
                                    boolean how)
Description copied from interface: IChart
Sets the change views parameter.

Specified by:
setChangeViewsParameter in interface IChart
Overrides:
setChangeViewsParameter in class ChartImpl
Parameters:
changePar - the change par
how - the how

getChangeViewParameter

public boolean getChangeViewParameter(java.lang.String changePar)
Description copied from interface: IChart
Gets the change view parameter.

Specified by:
getChangeViewParameter in interface IChart
Overrides:
getChangeViewParameter in class ChartImpl
Parameters:
changePar - the change par
Returns:
the change view parameter

getChangeViewParameterLabel

public java.lang.String getChangeViewParameterLabel(java.lang.String changePar,
                                                    int i)
Description copied from interface: IChart
Gets the change view parameter label.

Specified by:
getChangeViewParameterLabel in interface IChart
Overrides:
getChangeViewParameterLabel in class ChartImpl
Parameters:
changePar - the change par
i - the i
Returns:
the change view parameter label