Hi, I am trying to create a grouped bar chart in G...
# gooddata-legacy
v
Hi, I am trying to create a grouped bar chart in GoodData, where bars should appear side by side for each category. However, the chart is rendering as shown below, with bars appearing separated instead of properly grouped. Could you please guide me on how to configure the attributes/measures correctly to achieve a grouped bar chart in GoodData?
m
Hi Venus, you can create a grouped bar chart by configuring the View by and Metrics sections. The behavior of the chart depends on whether you are using multiple metrics or multiple attributes. Grouping by Multiple Metrics (Standard Grouping): If you want to compare different metrics (e.g., Sales vs. Cost) for each category, place multiple items in the Metrics section and one attribute in the View by section. This will automatically render the bars side-by-side for each attribute value. Note: Ensure the Stack by section is empty. If “Stack metrics” is enabled in the configuration, the bars will stack instead of appearing side-by-side Grouping by Multiple Attributes: If you are using a single metric but want to group it by two different categories (e.g., Year grouped within Region), add both attributes to the View by section. You may also find the following documentation useful: Bar Charts Documentation.
v
Thanks! It was useful, but I’m facing two issues now. First, I want to set titles for the legend and the Y-axis; however, the configuration does not provide options to define them explicitly. Second, when the value is 0, nothing is displayed on the chart. At the very least, a thin line or bar should be visible to represent zero values.
m
In Analytical Designer, the axis name is automatically inherited from the name of the first metric or attribute in that section Configure Insight Properties. To change the axis title, you must rename the metric or attribute itself. By default, the platform treats null values as empty space, which often results in missing bars or points. The
IFNULL
Function: To ensure a “0” is rendered (allowing for a visible line or bar), you should wrap your metric in a MAQL
IFNULL
statement. This replaces null values with a 0, forcing the visualization to plot a value for that category: https://www.gooddata.com/docs/cloud/create-metrics/maql/conditionals/ifnull/ For line charts specifically, the “Continuous Line” option in the configuration menu will connect points across missing data, but it will not “drop” to zero unless the metric is explicitly defined as 0 using the function above.