create-chart-using-chartjs
Generate customizable charts using Chart.js with options to retrieve image URLs or save directly to files. Specify dimensions, formats, and styles for precise visual data representation.
Instructions
Create a chart using QuickChart.io - get chart image URL or save chart image to file
Input Schema
Name | Required | Description | Default |
---|---|---|---|
action | Yes | Whether to get chart URL or save chart as file | |
backgroundColor | No | Canvas background color - rgb, hex, hsl, or color names (default: transparent) | |
chart | Yes | Chart.js configuration object | |
devicePixelRatio | No | Pixel ratio for Retina support (default: 2) | |
encoding | No | Chart configuration encoding method (default: url) | |
format | No | Output format (default: png) | |
height | No | Pixel height (default: 300) | |
key | No | API key (optional) | |
outputPath | No | Path where to save the file (only used with action=save_file) | |
version | No | Chart.js version - '2', '3', '4', or specific version (default: '2.9.4') | |
width | No | Pixel width (default: 500) |
Input Schema (JSON Schema)
{
"properties": {
"action": {
"description": "Whether to get chart URL or save chart as file",
"enum": [
"get_url",
"save_file"
],
"type": "string"
},
"backgroundColor": {
"description": "Canvas background color - rgb, hex, hsl, or color names (default: transparent)",
"type": "string"
},
"chart": {
"additionalProperties": true,
"description": "Chart.js configuration object",
"properties": {
"data": {
"additionalProperties": true,
"description": "Chart data",
"properties": {
"datasets": {
"description": "Datasets to display in the chart",
"items": {
"additionalProperties": true,
"properties": {
"backgroundColor": {
"description": "Background color(s)"
},
"borderColor": {
"description": "Border color(s)"
},
"data": {
"description": "Data points"
},
"label": {
"description": "Label for this dataset",
"type": "string"
}
},
"required": [
"data"
],
"type": "object"
},
"type": "array"
},
"labels": {
"description": "Labels for the data points",
"items": {},
"type": "array"
}
},
"required": [
"datasets"
],
"type": "object"
},
"options": {
"additionalProperties": true,
"description": "Chart.js options",
"type": "object"
},
"type": {
"description": "The type of chart to generate",
"enum": [
"bar",
"line",
"pie",
"doughnut",
"radar",
"polarArea",
"scatter",
"bubble",
"radialGauge",
"speedometer"
],
"type": "string"
}
},
"required": [
"type",
"data"
],
"type": "object"
},
"devicePixelRatio": {
"description": "Pixel ratio for Retina support (default: 2)",
"enum": [
1,
2
],
"type": "integer"
},
"encoding": {
"description": "Chart configuration encoding method (default: url)",
"enum": [
"url",
"base64"
],
"type": "string"
},
"format": {
"description": "Output format (default: png)",
"enum": [
"png",
"webp",
"jpg",
"svg",
"pdf",
"base64"
],
"type": "string"
},
"height": {
"description": "Pixel height (default: 300)",
"type": "integer"
},
"key": {
"description": "API key (optional)",
"type": "string"
},
"outputPath": {
"description": "Path where to save the file (only used with action=save_file)",
"type": "string"
},
"version": {
"description": "Chart.js version - '2', '3', '4', or specific version (default: '2.9.4')",
"type": "string"
},
"width": {
"description": "Pixel width (default: 500)",
"type": "integer"
}
},
"required": [
"action",
"chart"
],
"type": "object"
}