generate_dual_axis_chart
Create a dual-axis chart to compare two quantitative variables using bar and line series. Visualize trends and magnitudes across distinct y-axes for clear data analysis.
Instructions
Generate a dual-axis chart for visualizing two quantitative variables using a combination of bar and line series. Ideal for comparing trends and magnitudes across two metrics with distinct y-axes.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
background | No | Chart background color (hex). Optional, defaults to white. | |
chartTheme | No | Chart theme. Optional, defaults to 'light'. | |
colorField | No | Color grouping field. Should not duplicate the dimension field. | |
colors | No | Color palette for chart elements. | |
dataTable | Yes | Input data for the dual axis chart, e.g., [{ x: '2018', gmv: 99.9, user: 1200 }]. | |
height | No | Chart height. Optional, defaults to 500. | |
leftYAxisHasGrid | No | Show horizontal grid lines for the Y-axis. | |
leftYAxisHasLabel | No | Show Y-axis labels. | |
leftYAxisHasTick | No | Show Y-axis ticks. | |
leftYAxisTitle | No | Y-axis title. | |
output | No | Chart output type. Defaults to 'image'. | image |
rightYAxisHasGrid | No | ||
rightYAxisHasLabel | No | ||
rightYAxisHasTick | No | ||
rightYAxisTitle | No | ||
stackOrPercent | No | Stacking mode: 'stack' for stacked data, 'percent' for percentage stacking. Requires 'color' field. | |
subTitle | No | Chart subtitle text. | |
title | No | Chart title text. | |
titleOrient | No | Title position in the chart. | |
width | No | Chart width. Optional, defaults to 500. | |
xAxisHasGrid | No | Show vertical grid lines for the X-axis. | |
xAxisHasLabel | No | Show X-axis labels. | |
xAxisHasTick | No | Show X-axis ticks. | |
xAxisOrient | No | X-axis position in the chart. | |
xAxisTitle | No | X-axis title. | |
xField | Yes | Dimension field. Must exist in the data. | |
yField | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"background": {
"description": "Chart background color (hex). Optional, defaults to white.",
"type": "string"
},
"chartTheme": {
"description": "Chart theme. Optional, defaults to 'light'.",
"enum": [
"light",
"dark"
],
"type": "string"
},
"colorField": {
"description": "Color grouping field. Should not duplicate the dimension field.",
"type": "string"
},
"colors": {
"anyOf": [
{
"items": {
"description": "Color value",
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Color palette for chart elements."
},
"dataTable": {
"description": "Input data for the dual axis chart, e.g., [{ x: '2018', gmv: 99.9, user: 1200 }].",
"minItems": 1,
"type": "array"
},
"height": {
"description": "Chart height. Optional, defaults to 500.",
"type": "number"
},
"leftYAxisHasGrid": {
"description": "Show horizontal grid lines for the Y-axis.",
"type": "boolean"
},
"leftYAxisHasLabel": {
"description": "Show Y-axis labels.",
"type": "boolean"
},
"leftYAxisHasTick": {
"description": "Show Y-axis ticks.",
"type": "boolean"
},
"leftYAxisTitle": {
"description": "Y-axis title.",
"type": "string"
},
"output": {
"default": "image",
"description": "Chart output type. Defaults to 'image'.",
"enum": [
"spec",
"image",
"html"
],
"type": "string"
},
"rightYAxisHasGrid": {
"$ref": "#/properties/leftYAxisHasGrid"
},
"rightYAxisHasLabel": {
"$ref": "#/properties/leftYAxisHasLabel"
},
"rightYAxisHasTick": {
"$ref": "#/properties/leftYAxisHasTick"
},
"rightYAxisTitle": {
"$ref": "#/properties/leftYAxisTitle"
},
"stackOrPercent": {
"description": "Stacking mode: 'stack' for stacked data, 'percent' for percentage stacking. Requires 'color' field.",
"enum": [
"stack",
"percent"
],
"type": "string"
},
"subTitle": {
"description": "Chart subtitle text.",
"type": "string"
},
"title": {
"description": "Chart title text.",
"type": "string"
},
"titleOrient": {
"description": "Title position in the chart.",
"enum": [
"top",
"left",
"right",
"bottom"
],
"type": "string"
},
"width": {
"description": "Chart width. Optional, defaults to 500.",
"type": "number"
},
"xAxisHasGrid": {
"description": "Show vertical grid lines for the X-axis.",
"type": "boolean"
},
"xAxisHasLabel": {
"description": "Show X-axis labels.",
"type": "boolean"
},
"xAxisHasTick": {
"description": "Show X-axis ticks.",
"type": "boolean"
},
"xAxisOrient": {
"description": "X-axis position in the chart.",
"enum": [
"bottom",
"top"
],
"type": "string"
},
"xAxisTitle": {
"description": "X-axis title.",
"type": "string"
},
"xField": {
"description": "Dimension field. Must exist in the data.",
"minLength": 1,
"type": "string"
},
"yField": {
"items": {
"description": "Measure field. Must be numeric and exist in the data.",
"minLength": 1,
"type": "string"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": [
"dataTable",
"xField",
"yField"
],
"type": "object"
}