help Merging Charts in WebI | SAP BusinessObjects

Monday, May 25, 2015

Merging Charts in WebI

Requirement
To plot a Cross tab into a Bar/Line chart in such a way that Measure 2 forms a bar chart for all Zones for a particular Date and Measure 1 forms a Line chart for each Zones for a particular Date. This is the tricky part because we need 2 measures to behave in 2 different way in the same chart. To my knowledge this cannot be achieved in a single chart and hence we will plot them separately and then merge them.  Pic1.JPG

Preparing the Dataset - First we will create a data set for plotting our graph

Below is a Crosstab table which has Date along the Vertical Axis and Zone along the Horizontal Axis and a Measure Amount on the Body Axis

Pic2.JPG

Also will create a variable Average which will be Measure 2 and add a column at the end of the table. So, that’s how the table and our data objects looks like

Pic3.JPG
Plotting the Chart

Now we will try to plot this data into a Bar/Line. We will select the Combined Column Line chart. X Axis will be the Date. Value Axis will be the Average(Bar) and Amount(Line). And since we need the Line chart for each Zone, we will select the Region Color as Zone.Pic4.JPG
Right Click Chart -> Format Chart and make sure you select the below option from the Measure properties. So that Average is Bar and Amount is Line.
Pic5.JPG
And we get the below Chart. The issue with this is; the Average also get separated for each Zone which is not something that we want. We want the Region Color to be applied only on Amount and not on Average.

Pic6.JPG
Workaround - Following are the steps taken for the workaround.

       1. Create 2 separate charts
       2. Format the charts
       3. Place the chart on top of each other

Creating a Bar Chart

Create a bar chart for the Average as shown below. We will not select Region Color since we don’t need this to separate into the Zones.

Pic7.JPG
This is how the chart looks like and exactly what we want.

Pic8.JPG
Creating a Line Chart

Create the Line Chart. Here we will select the Region Color since we want to separate the Amount into zones

Pic9.JPG
This is how the chart looks like and exactly what we want

Pic10.JPG

Formatting the Bar Chart

First we need to format the base chart (BAR) as shown below.Right Click on the Bar Chart - > Select Chart Properties

Goto the Value Axis tab and select the Design option. This is to fix the Y-Axis. Make sure to select the Maximum value in such a way that it is higher than all measure values in the table

Pic11.JPG

Scroll down below and hide the text of the Value Axis by selecting the color as white. Don’t uncheck the Visible checkbox else the chart will get dislocated.

Pic12.JPG
Similarly goto the Title option and hide the text as well

Pic13.JPG

Repeat the same for Category Axis and hide the text of the Title and Design Option as shown below

Pic14.JPG
Pic15.JPG

Hide the legend Title

Pic16.JPG

Change the position of the Legend value

Pic17.JPG

And the Bar Chart will look like as below

Pic18.JPG

Formatting the Line Chart

The first and most important thing is the make the Y Axis of line chart same as Bar Chart. This is because when we put the chart on top of each other, we want the axis to be same. For formatting right click on the Line chart -> Select Chart Formatting

Pic19.JPG

Next we remove the legend title from the Legend -> Title

Pic20.JPG
Goto the Value Axis -> Title and give a custom title name

Pic21.JPG
The next important part, is to make Line Chart transparent so that when it is placed on top of the Bar Chart, we can see both the chart. For this reduce the RGBA Color to 46%.

Pic22.JPG
We won’t touch the Category Axis because we want to see the Axis details when we plot the charts. One more setting that we would do is make the background white for the line chart.

Pic23.JPG

Now our Line chart will look like as below

Pic24.JPG
Merging the Charts

Now the last part of this trick, make the relative position of the Line Chart same as that of the Bar chart

Pic25.JPG

And we get the Chart as shown below which matches with our requirementPic27.JPG

0 comments:

Post a Comment