Skip to content
On this page

LineChart

A chart for visualizing trends across a sequence of values.

LineChart in FluttyUILineChart in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

LineChart

const LineChart({
  super.key,
  required super.data,
  required super.xKey,
  required super.yKeys,
  super.series,
  super.width,
  super.height,
  super.aspectRatio,
  super.xAxis,
  super.yAxis,
  super.domain,
  super.xDomain,
  super.padding,
  super.animation,
  super.resetKey,
  super.interaction,
  super.controller,
  super.onSelectionChanged,
  super.onChartBoundsChange,
  super.emptyBuilder,
  super.domainPadding,
  super.drawOn,
  super.semanticsLabel = 'Line chart',
});
ParameterTypeRequiredDefault
keyKey?Nonull
dataList<ChartDatum>Yes—
xKeyStringYes—
yKeysList<String>Yes—
seriesList<ChartSeries>?Nonull
widthdouble?Nonull
heightdouble?Nonull
aspectRatiodoubleNo1.6
xAxisChartAxisNoconst ChartAxis()
yAxisChartAxisNoconst ChartAxis(showGrid: true)
domainChartDomainNoconst ChartDomain()
xDomainChartDomainNoconst ChartDomain()
paddingEdgeInsetsNoconst EdgeInsets.all(12)
animationChartAnimationNoconst ChartAnimation()
resetKeyObject?Nonull
interactionChartInteractionNoconst ChartInteraction()
controllerChartController?Nonull
onSelectionChangedValueChanged<ChartSelection?>?Nonull
onChartBoundsChangeValueChanged<Rect>?Nonull
emptyBuilderWidgetBuilder?Nonull
domainPaddingEdgeInsetsNoconst EdgeInsets.all(8)
drawOnboolNotrue
semanticsLabelStringNo'Line chart'

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/charts/line_chart/line_chart.dart

This reference is generated from the LineChart declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI