it.eng.spagobi.engines.chart.bo.charttypes.boxcharts
Class SimpleBox

java.lang.Object
  extended by it.eng.spagobi.engines.chart.bo.ChartImpl
      extended by it.eng.spagobi.engines.chart.bo.charttypes.boxcharts.BoxCharts
          extended by it.eng.spagobi.engines.chart.bo.charttypes.boxcharts.SimpleBox
All Implemented Interfaces:
IChart

public class SimpleBox
extends BoxCharts


Field Summary
 
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, simpleblockchart, 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
SimpleBox()
           
 
Method Summary
 DatasetMap calculateValue()
          Inherited by IChart: calculates chart value.
 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 datasetMap)
          This function creates the chart object.
 org.jfree.data.general.Dataset filterDataset(org.jfree.data.general.Dataset dataset, java.util.HashMap categories, int catSelected, int numberCatsVisualization)
          Use for slider: limits the categories visualization from cat selected to cat selected+numberscatsVisualization.
 
Methods inherited from class it.eng.spagobi.engines.chart.bo.charttypes.boxcharts.BoxCharts
getCategories, getCategoriesNumber, getCategoryLabel, getConfParameters, getNumberCatVisualization, getValueLabel, setCategoriesNumber, setCategoryLabel, setConfParameters, setNumberCatVisualization, setValueLabel
 
Methods inherited from class it.eng.spagobi.engines.chart.bo.ChartImpl
createChart, drawLegend, getChangeViewLabel, getChangeViewParameter, getChangeViewParameterLabel, getColor, getConfDataset, getData, getHeight, getLegendPosition, getLocale, getMultichart, getName, getOrientationMultichart, getParametersObject, getPositionSlider, getPossibleChangePars, getProfile, getSeriesLabels, getSubName, getSubtype, getTitleDimension, getType, getWidth, isChangeableView, isFilter, isLegend, isLinkable, isLovConfDefined, isSlider, isSliderStartFromEnd, setChangeViewChecked, setChangeViewsParameter, 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
 

Constructor Detail

SimpleBox

public SimpleBox()
Method Detail

calculateValue

public DatasetMap calculateValue()
                          throws java.lang.Exception
Description copied from class: BoxCharts
Inherited by IChart: calculates chart value.

Specified by:
calculateValue in interface IChart
Overrides:
calculateValue in class BoxCharts
Returns:
the dataset
Throws:
java.lang.Exception - the exception

configureChart

public void configureChart(it.eng.spago.base.SourceBean content)
Description copied from class: BoxCharts
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 BoxCharts
Parameters:
content - the content

createChart

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

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

filterDataset

public org.jfree.data.general.Dataset filterDataset(org.jfree.data.general.Dataset dataset,
                                                    java.util.HashMap categories,
                                                    int catSelected,
                                                    int numberCatsVisualization)
Description copied from class: BoxCharts
Use for slider: limits the categories visualization from cat selected to cat selected+numberscatsVisualization.

Specified by:
filterDataset in interface IChart
Overrides:
filterDataset in class BoxCharts
Parameters:
dataset - the dataset
categories - the categories
catSelected - the cat selected
numberCatsVisualization - the number cats visualization
Returns:
the dataset