Add data set to Line chart
Function: Add data set to Line chart
Enables the addition of a complete data set to a "Line chart UI element", facilitating dynamic data visualization. This action allows you to define the data points, appearance, and behavior of a new line within an existing line chart.
Input
- Line chart UI element (PART): The specific Line chart on your page where you want to add this new data set. This is a required input.
- Code (STRING): A unique identifier for this data set. This is a required input.
- Name (STRING): The display name for this data set, which will appear in the chart's legend. This is a required input.
- Line width (NUMBER): The thickness of the line for this data set. For example,
2
for a standard line. - Line type (SELECT_ONE): Choose the style of the line.
- Solid: A continuous line.
- Dashed: A line made of dashes.
- Dotted: A line made of dots.
- Line color (STRING): The color of the line, specified as a hexadecimal value (e.g.,
#FF0000
for red). This is a required input. - Area color (STRING): The color to fill the area beneath the line, specified as a hexadecimal value.
- Area transparency (NUMBER): How transparent the filled area beneath the line should be. Enter a value between
0
(completely transparent) and1
(fully opaque). - Smooth lines (BOOLEAN): Set to
True
if you want the line to appear smooth and curved, orFalse
for sharp, angular lines. - Stack (STRING): Assign a common value here to stack this data set with others. Data sets with the same "Stack" value will be visually stacked on top of each other in the chart.
- Points (STRING): A list of numbers, separated by semicolons (e.g.,
10;20;15;30
), that represent the Y-axis values for each point in the line. The X-axis labels are automatically generated based on the order of these points. This is a required input.
Output
This action does not produce a direct output variable. Instead, it modifies the specified "Line chart UI element" by adding the new data set to it, which will then be visually updated on your page.
Execution Flow
Real-Life Examples
Example 1: Displaying Monthly Sales Data
Imagine you have a "Sales Trend" line chart on your dashboard, and you want to add the sales figures for the current quarter.
- Inputs:
- Line chart UI element:
Sales Trend Chart
- Code:
Q1_Sales_2024
- Name:
Q1 Sales 2024
- Line color:
#4CAF50
(Green) - Points:
12000;15000;13500
- Line chart UI element:
- Result: The "Sales Trend Chart" now displays a new green line representing the Q1 sales, with points at 12,000, 15,000, and 13,500 for the three months.
Example 2: Visualizing Website Traffic with Custom Styling
You want to add a data set for "Daily Unique Visitors" to your "Website Analytics" chart, making the line smooth and dashed.
- Inputs:
- Line chart UI element:
Website Analytics Chart
- Code:
Unique_Visitors
- Name:
Daily Unique Visitors
- Line width:
3
- Line type:
Dashed
- Line color:
#2196F3
(Blue) - Smooth lines:
True
- Points:
500;520;480;550;530
- Line chart UI element:
- Result: The "Website Analytics Chart" updates to show a thick, smooth, dashed blue line representing the daily unique visitors, making the trend easier to follow.
Example 3: Stacking Project Progress for a Combined View
You are tracking the progress of two sub-tasks, "Design" and "Development," for a project and want to see their combined progress in a "Project Progress" chart.
- Inputs (for "Design" task):
- Line chart UI element:
Project Progress Chart
- Code:
Design_Progress
- Name:
Design Progress
- Line color:
#FFC107
(Amber) - Area color:
#FFECB3
- Area transparency:
0.7
- Stack:
ProjectX_Tasks
- Points:
10;25;40
- Line chart UI element:
- Inputs (for "Development" task):
- Line chart UI element:
Project Progress Chart
- Code:
Dev_Progress
- Name:
Development Progress
- Line color:
#9C27B0
(Purple) - Area color:
#E1BEE7
- Area transparency:
0.7
- Stack:
ProjectX_Tasks
- Points:
5;10;15
- Line chart UI element:
- Result: The "Project Progress Chart" now displays two stacked lines. The "Development Progress" line sits on top of the "Design Progress" line, with their respective areas filled, providing a clear visual of the individual and combined progress of "ProjectX_Tasks".