Skip to main content
Version: 1.0.8

Line Chart

Line series over a category axis, with smooth / step / area / stack toggles. Bind it to a named query — this is for query results, not for tag history (use Historian for that).

The Line Chart component as it renders with its default settings.The Line Chart component as it renders with its default settings.

Reach for it when you need:

  • Production by hour from a database
  • Any query result that is a series over categories

Component name: LineChart · Category: Chart

In the palette: Line series over a category axis — toggle smooth / step / area / stack. Bind data to a named query; click a point to expose {{point.value}}.

Properties​

Any property can be bound to a tag, another component's property, or a query.

PropertyTypeDefaultDescription
dataarray[{"month":"Jan","revenue":120,"target":100},{"month":"Feb","… (truncated)Array of row objects. Bind to a named query ({{query.MyQuery}}), a tag, or edit inline. Rows map to series via categoryField + seriesFields (auto-derived when empty).
categoryFieldstring""Row key for the category/name axis. Empty ⇒ first non-numeric column.
seriesFieldsarray[]Which columns become series (+ per-series color, and stack/area/renderAs where they apply). Empty ⇒ all numeric columns.
  ↳ seriesFields.fieldstring""Row column supplying this series' values.
  ↳ seriesFields.labelstring""Legend/tooltip label (defaults to the field name).
  ↳ seriesFields.colorcolor""Series color (empty ⇒ chart palette / theme).
  ↳ seriesFields.typeenumlineCombo: draw this series as a bar or a line. Defaults to the chart's own type (line). Options: bar · line.
  ↳ seriesFields.yAxisobject{"index":0,"show":true,"name":""}Bind this series to a Y-axis (own scale) + style it (title, show/hide; color follows the series). index 0 = primary. Vertical charts only.
    ↳ seriesFields.yAxis.indexnumber0Which Y-axis (own scale): 0 = primary/left, 1 = second/right, 2 = third/left, 3 = fourth/right.
    ↳ seriesFields.yAxis.showbooleantrueDraw this axis (line/labels/title). OFF = the series keeps its OWN scale but no axis is drawn (does NOT merge into the primary — bind index 0 for that).
    ↳ seriesFields.yAxis.namestring""Axis title (empty ⇒ none).
  ↳ seriesFields.stackstring""Stack group id — bars with the SAME id stack together; different ids = separate side-by-side stacks. Empty ⇒ unstacked (unless the chart-wide stack is on).
  ↳ seriesFields.dataLabelobject{"show":false,"position":"top"}Value label for this series.
    ↳ seriesFields.dataLabel.showbooleanfalse—
    ↳ seriesFields.dataLabel.positionenumtopOptions: top · bottom · left · right · inside · outside · center.
  ↳ seriesFields.symbolobject{"show":false,"symbolSize":4}—
    ↳ seriesFields.symbol.showbooleanfalseShow the dots/markers (off = just a line).
    ↳ seriesFields.symbol.symbolSizenumber4—
  ↳ seriesFields.smoothbooleanfalse—
  ↳ seriesFields.stepbooleanfalse—
  ↳ seriesFields.barWidthnumber0px (0 = auto).
  ↳ seriesFields.borderRadiusnumber2—
animationbooleantrueEnable enter/update animation.
animationDurationnumber600ms.
animationEasingenumcubicOutOptions: linear · cubicIn · cubicOut · cubicInOut · quadraticOut · elasticOut · bounceOut.
animationDelaynumber0Per-datum stagger (ms).
titleobject{"show":true,"text":"","subtext":"","left":"left"}—
  ↳ title.showbooleantrue—
  ↳ title.textstring""—
  ↳ title.subtextstring""—
  ↳ title.leftenumleftOptions: left · center · right.
legendobject{"show":true,"type":"plain","orient":"horizontal","left":"ce… (truncated)—
  ↳ legend.showbooleantrue—
  ↳ legend.typeenumplainOptions: plain · scroll.
  ↳ legend.orientenumhorizontalOptions: horizontal · vertical.
  ↳ legend.leftenumcenterOptions: left · center · right.
  ↳ legend.placementenumbottomOptions: top · bottom.
tooltipobject{"show":true,"trigger":"axis","axisPointerType":"line"}—
  ↳ tooltip.showbooleantrue—
  ↳ tooltip.triggerenumaxisitem = per datum; axis = whole category (cartesian). Options: item · axis · none.
  ↳ tooltip.axisPointerTypeenumlineOptions: line · shadow · cross.
colorPalettestring""Comma-separated series colors (e.g. #2563eb, #16a34a). Empty ⇒ theme palette.
backgroundColorcolor""Empty ⇒ transparent/theme.
xAxisobject{"show":true,"name":"","type":"category","min":"","max":"","… (truncated)—
  ↳ xAxis.showbooleantrue—
  ↳ xAxis.namestring""—
  ↳ xAxis.typeenumcategoryOptions: category · value · time · log.
  ↳ xAxis.minnumber""Empty ⇒ auto-scale.
  ↳ xAxis.maxnumber""Empty ⇒ auto-scale.
  ↳ xAxis.splitLinebooleanfalse—
  ↳ xAxis.boundaryGapbooleanfalse—
  ↳ xAxis.inversebooleanfalse—
  ↳ xAxis.rotatenumber0Rotate axis labels (degrees).
yAxisobject{"show":true,"name":"","type":"value","min":"","max":"","spl… (truncated)—
  ↳ yAxis.showbooleantrue—
  ↳ yAxis.namestring""—
  ↳ yAxis.typeenumvalueOptions: category · value · time · log.
  ↳ yAxis.minnumber""Empty ⇒ auto-scale.
  ↳ yAxis.maxnumber""Empty ⇒ auto-scale.
  ↳ yAxis.splitLinebooleantrue—
  ↳ yAxis.scalebooleanfalseDon't force the axis to start at zero.
  ↳ yAxis.inversebooleanfalse—
  ↳ yAxis.rotatenumber0Rotate axis labels (degrees).
gridobject{"left":8,"right":16,"containLabel":true}—
  ↳ grid.leftnumber8—
  ↳ grid.rightnumber16—
  ↳ grid.containLabelbooleantrue—
dataZoomobject{"enabled":false,"type":"inside","start":0,"end":100}—
  ↳ dataZoom.enabledbooleanfalse—
  ↳ dataZoom.typeenuminsideOptions: inside · slider · both.
  ↳ dataZoom.startnumber0—
  ↳ dataZoom.endnumber100—
stackbooleanfalse—
areabooleanfalse—
fillOpacitynumber0.25—
enableClickbooleantrueFire the Data click event + expose lastClicked.
lastClickedobject{}Output (bind from this): the last-clicked datum — {{ ThisChart.lastClicked.value }}.
optionOverridestring""Power user: paste a raw JSON object of chart options to deep-merge over the built chart, e.g. {"series":[{"itemStyle":{"color":"#e11"}}]}. Empty = none.
emptyMessagestringNo data—
stylestyle{}Custom CSS properties

Events​

Attach event actions to these in the Event Manager.

EventLabelGroupPayload
clickClickMouseThe DOM event.
dblclickDouble clickMouseThe DOM event.
contextmenuRight clickMouseThe DOM event.
mouseenterMouse enterMouseThe DOM event.
mouseleaveMouse leaveMouseThe DOM event.
dataClickData clickChartcontext.point — the clicked data point.
dataDblClickData double clickChartcontext.point — the clicked data point.
legendSelectLegend toggleChartThe toggled series.
Right-click behaves differently in the Designer

contextmenu fires your configured actions at runtime only — in LiveView and in preview. On the Designer canvas the right-click is captured to open the Event Manager, so testing it there will not run your actions. Test right-click in preview.