Categories

Stacked Bar Chart Generator

Generate interactive stacked bar charts to visualize categorical data composition, perfect for comparing multiple data series across categories

Data for the stacked bar chart in JSON format with category, series, and value fields

Title that will be displayed above the chart

JSON array of hex colors (requires Custom Colors selection)

Height of the chart in pixels (min: 300, max: 800)

Spacing between bars (0.1 - 0.5)

Background color for the chart container

Display values or percentages on the bars

Display color legend for series

Display horizontal grid lines

Animate bars when chart loads

Show percentages instead of values on bars

Show detailed information on hover

Key Facts

Category
Data Visualization
Input Types
textarea, text, select, number, color, checkbox
Output Type
html
Sample Coverage
4
API Ready
Yes

Overview

The Stacked Bar Chart Generator allows you to create interactive, professional-grade charts to visualize the composition of categorical data across multiple series. It is an ideal tool for comparing part-to-whole relationships and tracking trends across different categories with ease.

When to Use

  • When you need to compare the total values of different categories while showing the breakdown of sub-groups.
  • When you want to visualize how the composition of a specific metric changes across time periods or groups.
  • When you need to present complex multi-series data in a clean, interactive format for reports or presentations.

How It Works

  • Input your data in the required JSON format, specifying the category, series name, and corresponding value for each data point.
  • Customize the chart appearance by selecting a color scheme, adjusting the chart height, and toggling display options like grid lines or legends.
  • Choose your preferred value format, such as currency or percentage, to ensure the data is presented clearly.
  • Generate the interactive chart to view, hover for tooltips, or export for your project.

Use Cases

Visualizing quarterly sales performance broken down by individual product lines.
Comparing the demographic composition of different customer segments across regions.
Tracking budget allocation across various departments over multiple fiscal years.

Examples

1. Quarterly Product Sales Analysis

Sales Analyst
Background
A sales analyst needs to present how different product lines contributed to total revenue over four quarters.
Problem
Standard tables make it difficult to see the total growth while simultaneously identifying which products are driving that growth.
How to Use
Input the quarterly sales data for each product, set the value format to 'Currency ($)', and enable tooltips for detailed viewing.
Example Config
[{"category": "Q1", "series": "Product A", "value": 100}, {"category": "Q1", "series": "Product B", "value": 150}, {"category": "Q2", "series": "Product A", "value": 120}, {"category": "Q2", "series": "Product B", "value": 180}]
Outcome
A clear, interactive stacked bar chart showing total quarterly revenue with distinct color-coded segments for each product.

Try with Samples

json

Related Hubs

FAQ

What data format is required?

The tool requires a JSON array of objects, where each object contains 'category', 'series', and 'value' keys.

Can I use custom colors for my chart?

Yes, select 'Custom Colors' in the color scheme dropdown and provide a JSON array of hex color codes.

Does the chart support percentages?

Yes, you can toggle the 'Show Percentages' option to display the relative contribution of each segment instead of raw values.

Are the generated charts interactive?

Yes, the charts include hover-enabled tooltips to display detailed information for each segment.

Can I adjust the size of the chart?

Yes, you can specify the chart height in pixels, ranging from 300 to 800 pixels.

API Documentation

Request Endpoint

POST /en/api/tools/stacked-bar-chart

Request Parameters

Parameter Name Type Required Description
chartData textarea Yes Data for the stacked bar chart in JSON format with category, series, and value fields
chartTitle text No Title that will be displayed above the chart
colorScheme select No -
customColors textarea No JSON array of hex colors (requires Custom Colors selection)
valueFormat select No -
chartHeight number No Height of the chart in pixels (min: 300, max: 800)
barSpacing number No Spacing between bars (0.1 - 0.5)
backgroundColor color No Background color for the chart container
showValues checkbox No Display values or percentages on the bars
showLegend checkbox No Display color legend for series
showGrid checkbox No Display horizontal grid lines
showAnimation checkbox No Animate bars when chart loads
showPercentage checkbox No Show percentages instead of values on bars
enableTooltip checkbox No Show detailed information on hover

Response Format

{
  "result": "
Processed HTML content
", "error": "Error message (optional)", "message": "Notification message (optional)", "metadata": { "key": "value" } }
HTML: HTML

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-stacked-bar-chart": {
      "name": "stacked-bar-chart",
      "description": "Generate interactive stacked bar charts to visualize categorical data composition, perfect for comparing multiple data series across categories",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=stacked-bar-chart",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]