generate_line_chart
Create a line chart to visualize trends over time, such as sales vs. profits. Customize axes, themes, and formats (PNG, SVG). Supports multiple series, stacking, and smooth curves for detailed data analysis.
Instructions
Generate a line chart to show trends over time, such as, the ratio of Apple computer sales to Apple's profits changed from 2000 to 2016.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
axisXTitle | No | Set the x-axis title of chart. | |
axisYTitle | No | Set the y-axis title of chart. | |
data | Yes | Data for line chart, such as, [{ time: '2015', value: 23 }, { time: '2016', value: 32 }]. For multiple series: [{ group: 'Series A', time: '2015', value: 23 }, { group: 'Series B', time: '2015', value: 18 }]. | |
height | No | Set the height of the chart, default is 600px. | |
outputType | No | The output type of the diagram. Can be 'png', 'svg' or 'option'. Default is 'png', 'png' will return the rendered PNG image, 'svg' will return the rendered SVG string, and 'option' will return the valid ECharts option. | png |
showArea | No | Whether to fill the area under the line. Default is false. | |
showSymbol | No | Whether to show symbols on data points. Default is true. | |
smooth | No | Whether to use a smooth curve. Default is false. | |
stack | No | Whether stacking is enabled. When enabled, line charts require a 'group' field in the data. | |
theme | No | Set the theme for the chart, optional, default is 'default'. | default |
title | No | Set the title of the chart. | |
width | No | Set the width of the chart, default is 800px. |