Generate a Before/After or A/B Comparison Chart
meta_generate_comparison_chartCreate a side-by-side bar chart to compare metrics between two groups, such as time periods or campaign variants, for clear visual analysis.
Instructions
Generates a side-by-side comparison chart — perfect for comparing two time periods, two campaigns, or A/B test results.
Args:
title (string): Chart title
metrics (string[]): Metric names (y-axis labels)
group_a (object): { label: string, values: number[], color?: string }
group_b (object): { label: string, values: number[], color?: string }
chart_type (string): 'bar' or 'horizontalBar' (default: 'horizontalBar')
width (number): Width in pixels (default: 800)
height (number): Height in pixels (default: 400)
output_path (string, optional): Save PNG to this path
Example — comparing two weeks: title: "This Week vs Last Week" metrics: ["Impressions", "Reach", "Clicks", "Spend"] group_a: { label: "Last Week", values: [12000, 8000, 450, 150] } group_b: { label: "This Week", values: [15000, 10500, 620, 185] }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | ||
| metrics | Yes | Metric names (y-axis labels) | |
| group_a | Yes | ||
| group_b | Yes | ||
| chart_type | No | horizontalBar | |
| width | No | ||
| height | No | ||
| output_path | No | ||
| response_format | No | Output format: 'markdown' for human-readable or 'json' for machine-readable | markdown |