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

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.LinkableBar
All Implemented Interfaces:
ILinkableChart, IChart

public class LinkableBar
extends BarCharts
implements ILinkableChart

Author:
Giulio Gavardi giulio.gavardi@eng.it

Field Summary
 
Fields inherited from class it.eng.spagobi.engines.chart.bo.ChartImpl
color, confDataset, data, defaultLabelsStyle, filter, height, isLovConfDefined, legend, legendPosition, multichart, name, orientationMultichart, parametersObject, positionSlider, profile, seriesLabelsMap, slider, styleSubTitle, styleTitle, subName, subtype, titleDimension, type, width
 
Constructor Summary
LinkableBar()
           
 
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)
          Inherited by IChart.
 java.lang.String getCategoryUrlName()
          Gets the category url name.
 java.lang.String getDocument_Parameters(java.util.HashMap drillParameters)
          Gets document parameters and return a string in the form ¶m1=value1¶m2=value2 ...
 java.lang.String getDrillLabel()
          Gets the drill label.
 java.util.HashMap getDrillParameter()
          Gets the drill parameter.
 java.lang.String getMode()
          Gets the mode.
 java.lang.String getRootUrl()
          Gets the root url.
 java.lang.String getSerieUrlname()
          Gets the serie urlname.
 boolean isLinkable()
          Checks if is linkable.
 void setCategoryUrlName(java.lang.String categoryUrlName)
          Sets the category url name.
 void setDrillLabel(java.lang.String drillLabel)
          Sets the drill label.
 void setDrillParameter(java.util.HashMap drillParameter)
          Sets the drill parameter.
 void setMode(java.lang.String mode)
          Sets the mode.
 void setRootUrl(java.lang.String rootUrl)
          Sets the root url.
 void setSerieUrlname(java.lang.String serieUrlname)
          Sets the serie urlname.
 
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, getValueLabel, isFilterCategories, isFilterCatGroups, isFilterSeries, putSeriesNumber, setCategoriesNumber, setCategoryLabel, setCatGroupNames, setCatGroups, setConfParameters, setCurrentCatGroups, setCurrentSeries, setFilterCategories, setFilterCatGroups, setFilterSeries, setFilterStyle, setNumberCatVisualization, setNumberSerVisualization, setSeriesNames, setValueLabel
 
Methods inherited from class it.eng.spagobi.engines.chart.bo.ChartImpl
createChart, drawLegend, getChangeViewLabel, getChangeViewParameter, getChangeViewParameterLabel, getColor, getConfDataset, getData, getHeight, getLegendPosition, getMultichart, getName, getOrientationMultichart, getParametersObject, getPositionSlider, getPossibleChangePars, getProfile, getSeriesLabels, getSubName, getSubtype, getTitleDimension, getType, getWidth, isChangeableView, isFilter, isLegend, isLovConfDefined, isSlider, setChangeViewChecked, setChangeViewsParameter, setColor, setConfDataset, setData, setFilter, setHeight, setLegend, setLegendPosition, setLocalizedTitle, setLovConfDefined, setMultichart, setName, setOrientationMultichart, setParametersObject, setPositionSlider, setProfile, setSeriesLabels, setSlider, 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

LinkableBar

public LinkableBar()
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)
Inherited by IChart.

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

getDocument_Parameters

public java.lang.String getDocument_Parameters(java.util.HashMap drillParameters)
Gets document parameters and return a string in the form ¶m1=value1¶m2=value2 ...

Specified by:
getDocument_Parameters in interface ILinkableChart
Parameters:
drillParameters - the drill parameters
Returns:
the document_ parameters

getRootUrl

public java.lang.String getRootUrl()
Description copied from interface: ILinkableChart
Gets the root url.

Specified by:
getRootUrl in interface ILinkableChart
Returns:
the root url

setRootUrl

public void setRootUrl(java.lang.String rootUrl)
Description copied from interface: ILinkableChart
Sets the root url.

Specified by:
setRootUrl in interface ILinkableChart
Parameters:
rootUrl - the new root url

isLinkable

public boolean isLinkable()
Description copied from interface: IChart
Checks if is linkable.

Specified by:
isLinkable in interface IChart
Overrides:
isLinkable in class ChartImpl
Returns:
true, if is linkable

getMode

public java.lang.String getMode()
Description copied from interface: ILinkableChart
Gets the mode.

Specified by:
getMode in interface ILinkableChart
Returns:
the mode

setMode

public void setMode(java.lang.String mode)
Description copied from interface: ILinkableChart
Sets the mode.

Specified by:
setMode in interface ILinkableChart
Parameters:
mode - the new mode

getDrillLabel

public java.lang.String getDrillLabel()
Description copied from interface: ILinkableChart
Gets the drill label.

Specified by:
getDrillLabel in interface ILinkableChart
Returns:
the drill label

setDrillLabel

public void setDrillLabel(java.lang.String drillLabel)
Description copied from interface: ILinkableChart
Sets the drill label.

Specified by:
setDrillLabel in interface ILinkableChart
Parameters:
drillLabel - the new drill label

getDrillParameter

public java.util.HashMap getDrillParameter()
Description copied from interface: ILinkableChart
Gets the drill parameter.

Specified by:
getDrillParameter in interface ILinkableChart
Returns:
the drill parameter

setDrillParameter

public void setDrillParameter(java.util.HashMap drillParameter)
Description copied from interface: ILinkableChart
Sets the drill parameter.

Specified by:
setDrillParameter in interface ILinkableChart
Parameters:
drillParameter - the new drill parameter

getCategoryUrlName

public java.lang.String getCategoryUrlName()
Description copied from interface: ILinkableChart
Gets the category url name.

Specified by:
getCategoryUrlName in interface ILinkableChart
Returns:
the category url name

setCategoryUrlName

public void setCategoryUrlName(java.lang.String categoryUrlName)
Description copied from interface: ILinkableChart
Sets the category url name.

Specified by:
setCategoryUrlName in interface ILinkableChart
Parameters:
categoryUrlName - the new category url name

getSerieUrlname

public java.lang.String getSerieUrlname()
Description copied from interface: ILinkableChart
Gets the serie urlname.

Specified by:
getSerieUrlname in interface ILinkableChart
Returns:
the serie urlname

setSerieUrlname

public void setSerieUrlname(java.lang.String serieUrlname)
Description copied from interface: ILinkableChart
Sets the serie urlname.

Specified by:
setSerieUrlname in interface ILinkableChart
Parameters:
serieUrlname - the new serie urlname