Ask AI
Skip to main content

Add data set to Bar chart

Function: Add data set to Bar chart

This action allows you to dynamically add a new set of data to an existing Bar chart UI element on your application page. This is useful for displaying new information or updating charts based on user interactions or data changes without needing to rebuild the entire chart.

Input

  • Bar chart UI element: The specific Bar chart on your page where you want to add the new data set. This is a required input.
  • Code: A unique identifier for this new data set. This code helps you reference or update this specific data set later if needed. This is a required input.
  • Name: The display name for this data set, which will typically appear in the chart's legend. This is a required input. If not provided, the "Code" will be used as the name.
  • Color: The color you want the bars of this data set to have in the chart. You can provide a color name (e.g., "red") or a hexadecimal color code (e.g., "#FF0000"). If no color is specified, a default color will be used.
  • Stack: If you want this data set to be stacked on top of other data sets in the bar chart, provide a common value here. All data sets with the same "Stack" value will be grouped and stacked together. This is an optional input.
  • Points: A list of numbers, separated by semicolons (e.g., "10;25;15;30"), that represent the values for each bar in this data set. These numbers define the height of the bars. The chart will automatically generate labels for the x-axis based on the order of these points. This is a required input.

Output

This action does not produce a direct output value. Instead, it modifies the specified "Bar chart UI element" by adding the new data set to it, which will then be visible on your application page.

Execution Flow

Real-Life Examples

Example 1: Adding Monthly Sales Data

Imagine you have a Bar chart on your dashboard showing quarterly sales. You want to add a new data set for "Monthly Sales" for the current quarter.

  • Inputs:
    • Bar chart UI element: Sales_Overview_Chart
    • Code: Q3_Monthly_Sales
    • Name: Q3 Monthly Sales
    • Color: blue
    • Stack: (Leave empty)
    • Points: 12000;15000;13500
  • Result: The Sales_Overview_Chart will now display a new set of blue bars representing the monthly sales for the third quarter, alongside any existing data.

Example 2: Comparing Product Performance with Default Color

You have a Bar chart displaying website traffic by source. You want to add a new data set for a new marketing campaign's performance, but you're happy with the default color.

  • Inputs:
    • Bar chart UI element: Website_Traffic_Chart
    • Code: Campaign_X_Performance
    • Name: Campaign X
    • Color: (Leave empty)
    • Stack: (Leave empty)
    • Points: 500;750;600;900
  • Result: The Website_Traffic_Chart will update to include a new data set named "Campaign X" with bars in the default color, showing its performance over four periods.

Example 3: Stacking Regional Sales Data

You have a Bar chart showing total sales per product category. You want to break down these sales by region (North, South) and stack them to see the contribution of each region to the total.

  • Inputs (First Data Set - North Region):
    • Bar chart UI element: Product_Category_Sales
    • Code: North_Sales
    • Name: North Region
    • Color: #ADD8E6 (Light Blue)
    • Stack: Regional_Sales
    • Points: 200;350;180
  • Inputs (Second Data Set - South Region):
    • Bar chart UI element: Product_Category_Sales
    • Code: South_Sales
    • Name: South Region
    • Color: #FFB6C1 (Light Pink)
    • Stack: Regional_Sales
    • Points: 150;200;220
  • Result: The Product_Category_Sales chart will now display stacked bars for each product category. For example, the first bar will show a light blue segment (North Region sales) stacked with a light pink segment (South Region sales), visually representing the total sales and regional contributions.