linechart - Create a Line Chart
Creates a line chart with custom data and styling. Output can be an image or a PDF.
labels
array<string>
An array of labels to display.
Minimum: 1
Example:
[
"January",
"February",
"March",
"April",
"May",
"June",
"July"
]
data
array<object>
An array of data to be displayed
Minimum: 1
Example:
[
{
"label": "Expectations",
"values": [
30,
35,
58,
51,
81,
23,
77
],
"borderColor": "#a0a0a0",
"tension": 0.5,
"borderDash": [
5,
15
]
},
{
"label": "Value",
"values": [
10,
15,
38,
31,
91,
43,
67
],
"borderColor": "#FF9F40",
"fillColor": "#FF9F4033",
"tension": 0.5
},
{
"label": "Base Line",
"values": [
5,
10,
15,
20,
25,
30,
35
],
"borderColor": "#4BC0C0",
"fillColor": "#4BC0C033"
}
]
label
string
The text to associate with your dataset.
Example:
2022
values
array
The values of your dataset.
Minimum: 1
Example:
[
65,
59,
80,
81,
56,
55,
40
]
borderColor
HEX Color
The border color of your bar. Defaults to #000000 if no color is provided.
Example:
#FF9F40
borderDash
array
Length and spacing of dashes.
Example:
[
5,
15
]
fillColor
HEX Color
The fill color between your line and the axis.
Example:
#FF9F4033
tension
number
Bezier curve tension of the line. Set to 0 to draw straightlines. Defaults to 0.
Example:
0.5
options
object
Options to customize your chart.
Example:
{
"title": "Linechart Generation for Automation Platforms with 1001fx",
"titleAlignment": "center",
"titleColor": "#2563EB",
"subtitle": "Automatic linechart generation from as image and PDF. Highly customizable.",
"subtitleAlignment": "center",
"subtitleColor": "#333333",
"fontFamily": "Roboto",
"titleFontSize": 20,
"subtitleFontSize": 16,
"axisTitleFontSize": 16,
"axisFontSize": 16,
"dataLabelAnchor": "start",
"dataLabelAlignment": "top",
"dataLabelFontSize": 16,
"indexAxis": "x"
}
indexAxis
string
The base axis. Defaults to x.
Possible values are: x, y
Example:
y
title
string
The title to be displayed above your chart.
Example:
Anual Report
titleAlignment
string
Where to place your chart title. Defaults to center.
Possible values are: start, center, end
Example:
left
titleColor
HEX Color
The title's color. Defaults to #000000 if no color is provided.
Example:
#36A2EB
titleFontSize
number
The title's font size.
Example:
18
subtitle
string
The subtitle to be displayed above your chart.
Example:
Anual Report
subtitleAlignment
string
Where to place your chart subtitle. Defaults to center.
Possible values are: start, center, end
Example:
left
subtitleColor
HEX Color
The subtitle's color. Defaults to #000000 if no color is provided.
Example:
#4BC0C0
subtitleFontSize
number
The subtitleFontSize's font size.
Example:
18
backgroundColor
HEX Color
The chart's backgroundColor. Defaults to #ffffff if no color is provided.
Example:
#FFCD56
padding
number
The padding around your chart. Defaults to 50.
Example:
25
fontFamily
string
The font to use in your chart.
Possible values are: Alegreya, Barlow, Inter, Lato, Montserrat, OpenSans, Oswald, Poppins, PTSans, Raleway, Roboto
Example:
Roboto
dataLabelAnchor
string
Anchor position of your element. Defaults to center.
Possible values are: start, center, end
Example:
start
dataLabelAlignment
string
Defines the position of the label relative to the anchor point. Defaults to center.
Possible values are: start, center, end, left, top, right, bottom
Example:
top
dataLabelFontSize
number
The data label's font size
Example:
10
dataLabelOffset
number
Offset from the anchor point. Defaults to 0.
Example:
10
dataLabelsHidden
boolean
When true hides all data labels. Defaults to false.
Example:
dataLabelClamp
boolean
When true enforces the anchor position to be calculated based on the visible geometry of the associated element. Defaults to false.
Example:
yAxisTitle
string
Text to be displayed on the y axis.
Example:
Month
xAxisTitle
string
Text to be displayed on the x axis.
Example:
Value
axisTitleFontSize
number
The axis title's font size.
Example:
18
axisTitleColor
HEX Color
The axis title's color. Defaults to #000000 if no color is provided.
Example:
#4BC0C0
gridColor
HEX Color
The grid's color. Defaults to #f2f2f2 if no color is provided. Hide by setting to same as chart background color.
Example:
#4BC0C0
axisColor
HEX Color
The grid's color. Defaults to #a0a0a0 if no color is provided. Hide by setting to same as chart background color.
Example:
#9966FF
axisFontSize
number
The axis's font size.
Example:
18
outputFormat
string
The desired output format.
Possible values are: pdf, png, jpg
Example:
png