Data Visualization
Generate interactive stacked bar charts to visualize categorical data composition, perfect for comparing multiple data series across categories
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/stacked-bar-chart' \
-H 'Content-Type: application/json' \
-d '{"chartData":"JSON format:\n[{"category": "Q1", "series": "Product A", "value": 100},\n{"category": "Q1", "series": "Product B", "value": 150},\n{"category": "Q2", "series": "Product A", "value": 120},\n{"category": "Q2", "series": "Product B", "value": 180}]","chartTitle":"Enter chart title...","colorScheme":"default","customColors":"["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A"]","valueFormat":"number","chartHeight":"400","barSpacing":"0.2","backgroundColor":"#ffffff","showValues":true,"showLegend":true,"showGrid":true,"showAnimation":true,"showPercentage":false,"enableTooltip":true}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/stacked-bar-chart| 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 |
HTML result
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client 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://api.elysiatools.com/mcp/sse?toolId=stacked-bar-chart",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "stacked-bar-chart",
"arguments": {
"chartData": "JSON format:\n[{"category": "Q1", "series": "Product A", "value": 100},\n{"category": "Q1", "series": "Product B", "value": 150},\n{"category": "Q2", "series": "Product A", "value": 120},\n{"category": "Q2", "series": "Product B", "value": 180}]",
"chartTitle": "Enter chart title...",
"colorScheme": "default",
"customColors": "["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A"]",
"valueFormat": "number",
"chartHeight": "400",
"barSpacing": "0.2",
"backgroundColor": "#ffffff",
"showValues": true,
"showLegend": true,
"showGrid": true,
"showAnimation": true,
"showPercentage": false,
"enableTooltip": true
}
}
}Questions or issues? Contact [email protected]