4 min readUpdated Mar 2, 2026

GraphElement Documentation

Component Overview

The GraphElement is a versatile charting component designed for Vantage's analytics and data platform. It provides a visual representation of data through various chart types, including line, bar, and area charts. By integrating with workflow data, it dynamically renders charts to help users analyze trends, performance metrics, and other important datasets.

Purpose

The primary purpose of the GraphElement is to visualize data in a way that is both insightful and engaging. By allowing users to choose different types of graphs, this component helps facilitate data-driven decision-making in businesses. It is particularly beneficial in scenarios where real-time data representation is crucial for monitoring performance or trends.

Expected Data

The component expects the following data:

Settings

The settings for GraphElement are encapsulated within the config object of the element argument. Below is an exhaustive breakdown of each setting:

1. graphType

2. style

3. label

4. workflowIds

How It Works

The GraphElement utilizes the the charting engine library to render responsive charts. It contains a renderChart() function that dynamically decides which type of chart to display based on the graphType setting. Additionally, it includes a nested renderSeries() function that generates the appropriate chart elements (Lines, Bars, Areas) based on the selected graph type and the number of provided workflowIds.

The chart is responsive, adjusting to the size of its container, and utilizes mock data for display purposes. This mock data consists of hard-coded values organized by month, but this would ideally be replaced with dynamic data pulled from user-defined workflows.

Use Cases & Examples

Use Case 1: Sales Performance Monitoring

Business Context: A retail company wants to visualize its monthly sales performance across different product categories. By using the GraphElement, they can showcase the sales trends to identify high and low performers.

Use Case 2: Website Traffic Analysis

Business Context: A digital marketing team needs to chart website traffic data to understand visitor patterns over time. The GraphElement allows them to compare various traffic sources visually.

Use Case 3: Resource Utilization Reporting

Business Context: An IT department wants to track resource usage (CPU, memory, etc.) across multiple servers. The component helps visualize these metrics for easier identification of usage patterns.

Detailed Example Configuration

Scenario: Sales Performance Monitoring

To visualize sales data for a retail company that tracks sales across three categories: Electronics, Clothing, and Groceries, the staff can configure the GraphElement as follows:

javascript
const element = {
    label: 'Monthly Sales Performance',
    config: {
        graphType: 'bar',
        style: { backgroundColor: '#f9fafb' }
    },
    workflowIds: ['workflow_electronics', 'workflow_clothing', 'workflow_groceries']
};

In this configuration:

This configuration would allow the sales team to view a sharp, comparative bar chart displaying their sales performance across key categories, facilitating more informed decision-making.