How to create bar chart out of pie chart? (one bar, split by x axis entries)

Bryan Leow
edited February 11, 2022 in Analytics #1
I have the following info:

___
|    |
|    |                          ___
|    |                          |    |                           ___
|    |                          |    |                           |    |
===========================================
#1                             #2                              #3

I want to display it in a single bar chart like the following:

----
|   |
|   | 
|   |    #1
|   |
----
|   |    #2
|   |
----
|   |   #3
----

Preferably horizontally.

Essentially, I want to create a "pie chart" out of my data and display it in bar form instead of circular form. One bar, broken down into the individual entries in the x axis. The individual blocks representing each x axis entry has a length that corresponds to its y axis value.

It's exactly like this: https://www.youtube.com/watch?v=C-oT1zIKTbg but for BIRT instead of excel.

Comments

  • Hi Bryan,

    I have a few questions:
    1. What version of BIRT are you running?
    2. What is the Output Format of the chart (i.e. SVG, HTML5, etc.)?
    3. Are the bars (ignoring height) constant?  For example, if you are charting the number of people in a country, the number of people will obviously change, but are the countries always the same?
    Warning No formatter is installed for the format ipb
  • Bryan Leow
    edited May 15, 2020 #3
    Hi Jeff,

    Thanks for the reply!

    1. I am using 4.6.0:
    <div>Business Intelligence and Reporting Tools 
    
    </div><div>Version: 4.6.0.v201606072122 
    
    </div><div>Build id: v20160607-2112</div>

    2. I don't usually touch the Output Format setting so it's in SVG, the default format. I don't see HTML5 in my Output Format options (I only have PNG, JPG, BMP, SVG)

    3. Yes, the number of x axis entries and their names will be exactly the same all the time, e.g. it's always Country A, Country B, and Country C.
  • jfranken
    edited May 15, 2020 #4
    Hi Bryan,

    HTML5 is the default format for charts in the OpenText commercial designer.  It isn't an option in the Open Source designer which is why you don't see it.

    I have attached an example.  Here are the steps I took to create the single stack chart:
    1. Create a computed column in the data set for each of the categories.  My query returns 4 countries, so I added 4 computed columns, one for each country.  The column expression is standard JavaScript.  It sets the value to 0 unless the category and category data values match. 
    2. Add a groupBy column in the data set that sets the same string for every row.  It will be used to create the single stacked bar.  The data value you choose will appear as the X-axis label on the chart.
    3. Create a chart and select "Stacked Bar" or "Percentage Stacked Bar" for the chart type.
    4. On the Select Data tab, set the X-axis to the groupBy computed column.
    5. Add a Y-axis series for each of the other computed columns (countries).
    6. On the Format Chart tab, select "Series" and provide a name for each series.
    Let me know if you have any questions.
    Warning No formatter is installed for the format ipb
  • Works perfectly, thanks for the help!