DocsGitHub
Getting Started
  • Overview
  • Design Tokens
Components
  • Accordion
  • Alert
  • Announcement
  • Avatar
  • Badge
  • BigCalendar
  • Breadcrumb
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Checkbox
  • Chip
  • CloseButton
  • Combobox
  • CommandPalette
  • ContextMenu
  • Currency
  • DatePicker
  • DescriptionList
  • Drawer
  • DropdownMenu
  • EmptyState
  • Field
  • FileUpload
  • FormGrid
  • Hotkey
  • Icon
  • Input
  • Metric
  • Modal
  • MultiSelect
  • NumberInput
  • Pagination
  • Popover
  • ProgressBar
  • Radio
  • Rating
  • SegmentedControl
  • Select
  • SelectionCard
  • Sidebar
  • Skeleton
  • Slider
  • Spinner
  • Stepper
  • Switch
  • Table
  • Tabs
  • Textarea
  • Timeline
  • TimePicker
  • Toast
  • Tooltip
  • TransferList
  • TreeView
  • Wizard
Charts
  • Overview
  • Area Chart
  • Bar Chart
  • Donut Chart
  • Line Chart
  • Pie Chart
  • Stacked Bar Chart

Line Chart

A trend line chart for time-series and continuous data comparisons.

Installation

tsx
import { LineChart } from "madagent";

Default

Loading chart...

Props

PropTypeDefaultDescription
data*
Record<string, unknown>[]
-The chart data array
xAxisKey*
string
-The data key used for the x-axis
config*
ChartConfig
-Maps each series key to a label and color
showGrid
boolean
trueShow the cartesian grid
showTooltip
boolean
trueShow the tooltip on hover
showLegend
boolean
falseShow the chart legend
showYAxis
boolean
falseShow the y-axis
height
number
350Container height in pixels
showDots
boolean
trueShow dots on data points
type
"linear""natural""monotone""step"
"natural"Curve interpolation type
strokeWidth
number
2Line stroke width in pixels

RTL Support

Components automatically adapt to right-to-left languages using CSS logical properties.

Preview

Loading chart...

Usage

tsx
<LineChart
  data={[
    { month: "يناير", desktop: 186, mobile: 80 },
    { month: "فبراير", desktop: 305, mobile: 200 },
    { month: "مارس", desktop: 237, mobile: 120 },
  ]}
  xAxisKey="month"
  config={{
    desktop: { label: "سطح المكتب", color: "var(--md-chart-1)" },
    mobile: { label: "الجوال", color: "var(--md-chart-2)" },
  }}
  height={300}
  showLegend
/>