generate_dual_axes_chart
Visualize trends and comparisons by creating a dual axes chart combining a bar chart and a line chart, ideal for displaying sales and profit data over time.
Instructions
Generate a dual axes chart which is a combination chart that integrates two different chart types, typically combining a bar chart with a line chart to display both the trend and comparison of data, such as, the trend of sales and profit over time.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
axisXTitle | No | Set the x-axis title of chart. | |
categories | Yes | Categories for dual axes chart, such as, ['2015', '2016', '2017']. | |
height | No | Set the height of chart, default is 400. | |
series | Yes | Series for dual axes chart, such as, [{ type: 'column', data: [91.9, 99.1, 101.6, 114.4, 121], axisYTitle: '销售额' }, { type: 'line', data: [0.055, 0.06, 0.062, 0.07, 0.075], 'axisYTitle': '利润率' }]. | |
style | No | Custom style configuration for the chart. | |
theme | No | Set the theme for the chart, optional, default is 'default'. | default |
title | No | Set the title of chart. | |
width | No | Set the width of chart, default is 600. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"axisXTitle": {
"default": "",
"description": "Set the x-axis title of chart.",
"type": "string"
},
"categories": {
"description": "Categories for dual axes chart, such as, ['2015', '2016', '2017'].",
"items": {
"type": "string"
},
"minItems": 1,
"type": "array"
},
"height": {
"default": 400,
"description": "Set the height of chart, default is 400.",
"type": "number"
},
"series": {
"description": "Series for dual axes chart, such as, [{ type: 'column', data: [91.9, 99.1, 101.6, 114.4, 121], axisYTitle: '销售额' }, { type: 'line', data: [0.055, 0.06, 0.062, 0.07, 0.075], 'axisYTitle': '利润率' }].",
"items": {
"properties": {
"axisYTitle": {
"default": "",
"description": "Set the y-axis title of the chart series, such as, axisYTitle: '销售额'.",
"type": "string"
},
"data": {
"description": "When type is column, the data represents quantities, such as [91.9, 99.1, 101.6, 114.4, 121]. When type is line, the data represents ratios and its values are recommended to be less than 1, such as [0.055, 0.06, 0.062, 0.07, 0.075].",
"items": {
"type": "number"
},
"type": "array"
},
"type": {
"description": "The optional value can be 'column' or 'line'.",
"enum": [
"column",
"line"
],
"type": "string"
}
},
"required": [
"type",
"data"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"style": {
"description": "Custom style configuration for the chart.",
"properties": {
"backgroundColor": {
"description": "Background color of the chart, such as, '#fff'.",
"type": "string"
},
"palette": {
"description": "Color palette for the chart, it is a collection of colors.",
"items": {
"type": "string"
},
"type": "array"
},
"texture": {
"default": "default",
"description": "Set the texture for the chart, optional, default is 'default'. 'rough' refers to hand-drawn style.",
"enum": [
"default",
"rough"
],
"type": "string"
}
},
"type": "object"
},
"theme": {
"default": "default",
"description": "Set the theme for the chart, optional, default is 'default'.",
"enum": [
"default",
"academy",
"dark"
],
"type": "string"
},
"title": {
"default": "",
"description": "Set the title of chart.",
"type": "string"
},
"width": {
"default": 600,
"description": "Set the width of chart, default is 600.",
"type": "number"
}
},
"required": [
"categories",
"series"
],
"type": "object"
}