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
Direct Known Subclasses:
CombinedCategoryBar, OverlaidBarLine, OverlaidStackedBarLine

public class LinkableBar
extends BarCharts
implements ILinkableChart

Author:
Giulio Gavardi giulio.gavardi@eng.it

Field Summary
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, SHOW_VALUE_LABLES, VALUE_LABEL
 
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_stackedbarline, 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
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<java.lang.String,DrillParameter> _drillParametersMap)
          Gets document parameters and return a string in the form ¶m1=value1¶m2=value2 ...
 java.lang.String getDrillDocTitle()
          Gets the title of the drill Document
 java.lang.String getDrillLabel()
          Gets the drill label.
 java.util.HashMap<java.lang.String,DrillParameter> getDrillParametersMap()
          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.
 java.lang.String getTarget()
          Gets the target of the drill Document
 boolean isLinkable()
          Checks if is linkable.
 void setCategoryUrlName(java.lang.String categoryUrlName)
          Sets the category url name.
 void setDrillDocTitle(java.lang.String drillDocTitle)
          Sets the title of the drill Document.
 void setDrillLabel(java.lang.String drillLabel)
          Sets the drill label.
 void setDrillParametersMap(java.util.HashMap<java.lang.String,DrillParameter> drillParametersMap)
          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.
 void setTarget(java.lang.String target)
          Sets the target where to open the drill Document.
 
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, getChangeViewParameter, getChangeViewParameterLabel, getColor, getConfDataset, getData, getHeight, getLegendPosition, getLocale, getMultichart, getName, getOrientationMultichart, getParametersObject, getPositionSlider, getPossibleChangePars, getProfile, getSeriesLabels, getSubName, getSubtype, getTitleDimension, getType, getWidth, isChangeableView, isFilter, isLegend, 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
 

Field Detail

ORIENTATION

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

See Also:
Constant Field Values
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<java.lang.String,DrillParameter> _drillParametersMap)
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

getDrillParametersMap

public java.util.HashMap<java.lang.String,DrillParameter> getDrillParametersMap()
Description copied from interface: ILinkableChart
Gets the drill parameter.

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

setDrillParametersMap

public void setDrillParametersMap(java.util.HashMap<java.lang.String,DrillParameter> drillParametersMap)
Description copied from interface: ILinkableChart
Sets the drill parameter.

Specified by:
setDrillParametersMap in interface ILinkableChart

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

getDrillDocTitle

public java.lang.String getDrillDocTitle()
Description copied from interface: ILinkableChart
Gets the title of the drill Document

Specified by:
getDrillDocTitle in interface ILinkableChart

setDrillDocTitle

public void setDrillDocTitle(java.lang.String drillDocTitle)
Description copied from interface: ILinkableChart
Sets the title of the drill Document. If not exists, LABEL is taken

Specified by:
setDrillDocTitle in interface ILinkableChart
Parameters:
drillDocTitle - the drill document Title

getTarget

public java.lang.String getTarget()
Description copied from interface: ILinkableChart
Gets the target of the drill Document

Specified by:
getTarget in interface ILinkableChart

setTarget

public void setTarget(java.lang.String target)
Description copied from interface: ILinkableChart
Sets the target where to open the drill Document. If not exists or wrong, default is SELF(not in a new tab)

Specified by:
setTarget in interface ILinkableChart
Parameters:
target - where to open the drill Document: tab=new Tab / self=bread Crumbs