Skip to main content

Line Chart

info

For all component features for this component, click Line Chart page.
For plugin usage of this component, click Chart Data Labels page.

Props

AttributeDescriptionTypeDefault
xTypeFor Time Cartesian Axis use 'time'istring
xMinThe minimum item to display.string
xMaxThe maximum item to display.string
xReverseReverse the x scale.booleanfalse
yReverseReverse the y scale.booleanfalse
xTimeDisplayFormatsMillisecondSets how different time units are displayed.string"h:mm:ss.SSS aaaa"
xTimeDisplayFormatsSecondSets how different time units are displayed.string"h:mm:ss aaaa"
xTimeDisplayFormatsMinuteSets how different time units are displayed.string"h:mm aaaa"
xTimeDisplayFormatsHourSets how different time units are displayed.string"ha"
xTimeDisplayFormatsDaySets how different time units are displayed.string"MMM d"
xTimeDisplayFormatsWeekSets how different time units are displayed.string"PP"
xTimeDisplayFormatsMonthSets how different time units are displayed.string"MMM yyyy"
xTimeDisplayFormatsQuarterSets how different time units are displayed.string"qqq - yyyy"
xTimeDisplayFormatsYearSets how different time units are displayed.string"yyyy"
xTimeIsoWeekdayIf boolean and true and the unit is set to 'week', then the first day of the week will be Monday. Otherwise, it will be Sunday. If number, the index of the first day of the week (0 - Sunday, 6 - Saturday)boolean or number
xTimeParserCustom parser for datesstring
xTimeRoundIf defined, dates will be rounded to the start of this unit.string
xTimeTooltipFormatThe format string to use for the tooltip.string
xTimeUnitIf defined, will force the unit to be a certain type. See Time Units section below for details.string.
xTimeMinUnitThe minimum display format to be used for a time unit.string'millisecond'
xTicksColorColor of X ticks.string
xTicksFontFamilyFont Family of X ticks. Default font family for all text.string
xTicksFontSizeFont Size of X ticks. Default font size (in px) for text. Does not apply to radialLinear scale point labels.string12
xTicksFontStyleFont Style of X ticks. Default font style. Does not apply to tooltip title or footer. Does not apply to chart title.string'normal'
xTicksFontWeightFont Weight of X ticks. Default font weight (boldness).string'normal'
xTicksFontLineHeightFont Line Height of X ticks. Height of an individual line of text.string'1.2'
yTicksColorColor of Y ticks.string
yTicksFontFamilyFont Family of Y ticks. Default font family for all text.string
yTicksFontSizeFont Size of Y ticks. Default font size (in px) for text. Does not apply to radialLinear scale point labels.string12 .
yTicksFontStyleFont Style of Y ticks. Default font style. Does not apply to tooltip title or footer. Does not apply to chart title.string'normal'
yTicksFontWeightFont Weight of Y ticks. Default font weight (boldness).string'normal'
yTicksFontLineHeightFont Line Height of Y ticks. Height of an individual line of text.string'1.2'
xTitleTextText for the X-axis title.string
xTitleColorColor of the X-axis title.string
xTitleFontSizeFont size for the X-axis title (in px).string12
yTitleTextText for the Y-axis title.string
yTitleFontSizeFont size for the Y-axis title (in px).string12
yTitleColorColor of the Y-axis title.string
pointRadiusRadius of the point shapenumber3
pointStyleStyle of the point (e.g., 'circle', 'rect', 'triangle')string'circle'
pointRotationRotation of the point in degreesnumber
pointBackgroundColorFill color pf the pointstring
pointBorderWidthWidth of the point bordernumber
pointBorderColorColor of the point borderstring
pointHitRadiusPixel size to increase the hit area of the point for interactionnumber
pointHoverRadiusRadius of the point when hoverednumber
pointHoverBorderWidthBorder width of the point when hoverednumber
legendFontFamilyFont family used for legend labels (e.g., 'Arial', 'Roboto', 'sans-serif'). Inherits the global font if not specified.string
legendFontStyleFont style of the legend text (e.g., 'normal', 'italic', 'oblique').string
legendFontWeightFont weight (boldness) of the legend labels (e.g., 'normal', 'bold', 'lighter', 400, 700).string
legendFontLineHeightLine height of legend text. Can be a number (1.2) or a string ('20px', '150%').string

Events

AttributeDescriptionType
onClickA callback that is called when a click event is registered on a label item. Arguments: [event, legendItem, legend].function

Samples Component

Line Chart and Data Labels Usage

All of the component features(except options) can be use in this component www.chartjs.org.

All of the Chart Data Labels plugin features can be use in this component.

image

image

image

image

Time Cartesian Axis

Axes that follow a cartesian grid are known as 'Cartesian Axes'. Cartesian axes are used for line and bar charts. Time cartesian axes are included in Chart.js by default.

The time scale is used to display times and dates. Data are spread according to the amount of time between data points. When building its ticks, it will automatically calculate the most comfortable unit base on the size of the scale.

For More Information:

Time Cartesian Axis
Time Display Formats

image

Tooltip Label

tooltipLabel(context) event added to Charts component. Returns text to render for an individual item in the tooltip. The label can change the text that displays for a given data point.

For more detail Charts tooltip-callbacks

quick.return(context.formattedValue + " - " + context.label);

Ticks Font

Point Styling and Interaction Options

These properties allow customization of data point appearance and interaction behavior on the line chart. You can adjust the shape, size, color, border, and hover effects of the points rendered on the chart.


LineChart.qjson

Samples Qjson

LineChart.qjson
LineChartEvents.qjson
LineChart_Type_Time_Sample.qjson
Charts_Custom_Legend_Sample.qjson
Charts_tooltipLabel_sample.qjson