top of page

Dynamically Change RS ChartSize

ABSTRACT (by Federico Levis ) Category: RS

RS Tip: Dynamically change Chart Size. E.g. BarChart:

  1. Small

  2. Medium

  3. Large

1. Goal

Select Chart Size with a Prompt, to allow to the user modifying Size to "see better" the Chart (e.g to see all the selected Bars):

Examples: ChartSize=Small (Not all Bar all Visible) and ChartSize=Medium (all Bars are Visible)

Chart Size Prompt

2. RS Implementation Steps

  • Add a Value prompt with parameter=ChartSize and following Static Choice to select the possible BarChart Size:

  • Associate to the BarChart an AdvancedConditional Style with the desired CharSize width height associated to the possible Values of ChartSize Parameter:

a) The ChartSize Conditional Style Values can be set with Cognos GUI:

b) Or you can also add directly the advancedConditionalStyle with following XML Code:

<namedConditionalStyles> <advancedConditionalStyle name="ChartSize"> <styleCases> <styleCase><style><CSS value="width:800px;height:300px"/></style> <reportCondition>ParamValue('ChartSize') = 'SMALL'</reportCondition> </styleCase> <styleCase><style><CSS value="width:800px;height:450px"/></style> <reportCondition>ParamValue('ChartSize') = 'MEDIUM'</reportCondition> </styleCase> <styleCase><style><CSS value="width:1000px;height:600px"/></style> <reportCondition>ParamValue('ChartSize') = 'LARGE'</reportCondition> </styleCase> </styleCases> <styleDefault><style><CSS value="width:800px;height:450px"/></style></styleDefault> </advancedConditionalStyle> </namedConditionalStyles>

That's All

bottom of page