Back to LibraryCharts
Line Chart - Multiple
Added Jun 16, 2026
A smooth curved line chart with two data series (Category 1 + Category 2), powered by a Power Apps collection. Inspired by the shadcn/ui Line Chart - Multiple.
Dark Mode
Line Chart - Multiple
January - June 2024
Trending up by 5.2% this month
Showing total visitors for the last 6 months
CopySnips Live Preview
How to Use
- Create the collection: ClearCollect(colLineMulData, {month: "January", Category1: 186, Category2: 80}, {month: "February", Category1: 305, Category2: 200}, {month: "March", Category1: 237, Category2: 120}, {month: "April", Category1: 73, Category2: 190}, {month: "May", Category1: 209, Category2: 130}, {month: "June", Category1: 214, Category2: 140})
- On your screen's OnVisible, add: Set(varAnimLineMulChart, true); Set(varTooltipLineMulIdx, 0)
- Paste the copied YAML into Power Apps Studio (Ctrl+V).
- Click any data point to show a tooltip with both Category 1 and Category 2 values; click again to dismiss.
- To replay the animation: Set(varAnimLineMulChart, false); Set(varAnimLineMulChart, true)
- Replace colLineMulData with any data source that has {month, Category1, Category2} columns.
Problem Solved
Renders a smooth dual-series SVG line chart inside a Power Apps Image control with a grow-up animation. No external charting library needed.
Integration
Bind colLineMulData to any data source with {month, Category1, Category2} columns. The chart redraws automatically when the collection changes.
YAML Code
- conLineMulChart:
Control: GroupContainer@1.5.0
Variant: ManualLayout
Properties:
BorderColor: =RGBA(226, 232, 240, 1)
BorderStyle: =BorderStyle.Solid
BorderThickness: =1
DropShadow: =DropShadow.Regular
Fill: =RGBA(255, 255, 255, 1)
Height: =316
RadiusBottomLeft: =12
RadiusBottomRight: =12
RadiusTopLeft: =12
RadiusTopRight: =12
Width: =440
Children:
- tmrLineMulAnimate:
Control: Timer@2.0.0
Properties:
Duration: =1200
Height: =1
OnTimerEnd: =Set(varAnimLineMulChart, false)
Repeat: =false
Start: =varAnimLineMulChart
Visible: =false
Width: =1
X: =0
Y: =0
- lblLineMulTitle:
Control: Label@2.5.1
Properties:
Color: =RGBA(15, 23, 42, 1)
Font: =Font.'Open Sans'
FontWeight: =FontWeight.Bold
Height: =24
Size: =14
Text: ="Line Chart - Multiple"
Width: =400
X: =20
Y: =14
- lblLineMulDescription:
Control: Label@2.5.1
Properties:
Color: =RGBA(100, 116, 139, 1)
Font: =Font.'Open Sans'
Height: =20
Size: =12
Text: ="January - June 2024"
Width: =400
X: =20
Y: =44
- rectLineMulHeader:
Control: Rectangle@2.3.0
Properties:
Fill: =RGBA(226, 232, 240, 1)
Height: =1
Width: =440
X: =0
Y: =68
- imgLineMulChart:
Control: Image@2.2.3
Properties:
Height: =172
Width: =416
X: =12
Y: =72
Image: |-
=With(
{
_n: CountRows(colLineMulData),
_max: Max(1, Max(colLineMulData, Max(Category1, Category2))),
_slot: Int(400 / Max(1, CountRows(colLineMulData))),
_p: Min(1, tmrLineMulAnimate.Value / 1200)
},
With(
{ _ease: 1 - Power(Max(0, 1 - _p), 3) },
"data:image/svg+xml;utf8, " & EncodeUrl(
"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 416 172'>" &
"<line x1='8' y1='8' x2='408' y2='8' stroke='#e2e8f0' stroke-width='1'/>" &
"<line x1='8' y1='44' x2='408' y2='44' stroke='#e2e8f0' stroke-width='1'/>" &
"<line x1='8' y1='80' x2='408' y2='80' stroke='#e2e8f0' stroke-width='1'/>" &
"<line x1='8' y1='116' x2='408' y2='116' stroke='#e2e8f0' stroke-width='1'/>" &
"<line x1='8' y1='152' x2='408' y2='152' stroke='#e2e8f0' stroke-width='1'/>" &
"<path d='M " &
Text(Int(8 + (1 - 0.5)*_slot)) & "," & Text(Int(152 - Index(colLineMulData, 1).Category1/_max*144*_ease)) &
" L " & Text(Int(8 + _slot)) & "," & Text(Int(152 - (Index(colLineMulData, 1).Category1 + Index(colLineMulData, 2).Category1)*72/_max*_ease)) &
Concat(Sequence(_n - 2, 1),
" Q " & Text(Int(8 + (Value + 0.5)*_slot)) & "," & Text(Int(152 - Index(colLineMulData, Value + 1).Category1/_max*144*_ease)) &
" " & Text(Int(8 + (Value + 1)*_slot)) & "," & Text(Int(152 - (Index(colLineMulData, Value + 1).Category1 + Index(colLineMulData, Value + 2).Category1)*72/_max*_ease))
) &
" L " & Text(Int(8 + (_n - 0.5)*_slot)) & "," & Text(Int(152 - Index(colLineMulData, _n).Category1/_max*144*_ease)) &
"' fill='none' stroke='#3b82f6' stroke-width='2'/>" &
"<path d='M " &
Text(Int(8 + (1 - 0.5)*_slot)) & "," & Text(Int(152 - Index(colLineMulData, 1).Category2/_max*144*_ease)) &
" L " & Text(Int(8 + _slot)) & "," & Text(Int(152 - (Index(colLineMulData, 1).Category2 + Index(colLineMulData, 2).Category2)*72/_max*_ease)) &
Concat(Sequence(_n - 2, 1),
" Q " & Text(Int(8 + (Value + 0.5)*_slot)) & "," & Text(Int(152 - Index(colLineMulData, Value + 1).Category2/_max*144*_ease)) &
" " & Text(Int(8 + (Value + 1)*_slot)) & "," & Text(Int(152 - (Index(colLineMulData, Value + 1).Category2 + Index(colLineMulData, Value + 2).Category2)*72/_max*_ease))
) &
" L " & Text(Int(8 + (_n - 0.5)*_slot)) & "," & Text(Int(152 - Index(colLineMulData, _n).Category2/_max*144*_ease)) &
"' fill='none' stroke='#a855f7' stroke-width='2'/>" &
Concat(Sequence(_n),
"<text x='" & Text(Int(8 + (Value - 0.5)*_slot)) &
"' y='168' text-anchor='middle' font-family='Arial,sans-serif' font-size='11' fill='#94a3b8'>" &
Left(Index(colLineMulData, Value).month, 3) & "</text>"
) &
"</svg>"
)
)
)
- galLineMulInteract:
Control: Gallery@2.15.0
Variant: Horizontal
Properties:
Fill: =RGBA(0, 0, 0, 0)
Height: =152
Items: =Sequence(CountRows(colLineMulData))
ShowScrollbar: =false
TemplatePadding: =0
TemplateSize: =416 / Max(1, CountRows(colLineMulData))
Width: =416
X: =12
Y: =80
Children:
- btnLineMulHit:
Control: Button@0.0.45
Properties:
Appearance: ='ButtonCanvas.Appearance'.Transparent
Height: =Parent.TemplateHeight
OnSelect: =If(varTooltipLineMulIdx = ThisItem.Value, Set(varTooltipLineMulIdx, 0), Set(varTooltipLineMulIdx, ThisItem.Value))
Text: =""
Width: =Parent.TemplateWidth
X: =0
Y: =0
- conLineMulTooltip:
Control: GroupContainer@1.5.0
Variant: ManualLayout
Properties:
BorderColor: =RGBA(226, 232, 240, 1)
BorderStyle: =BorderStyle.Solid
BorderThickness: =1
DropShadow: =DropShadow.Regular
Fill: =RGBA(255, 255, 255, 1)
Height: =70
RadiusBottomLeft: =8
RadiusBottomRight: =8
RadiusTopLeft: =8
RadiusTopRight: =8
Visible: =varTooltipLineMulIdx > 0
Width: =120
X: =Max(20, Min(310, 20 + (varTooltipLineMulIdx - 0.5) * (400 / Max(1, CountRows(colLineMulData))) - 60))
Y: =86
Children:
- lblTooltipLineMulMonth:
Control: Label@2.5.1
Properties:
Color: =RGBA(100, 116, 139, 1)
Font: =Font.'Open Sans'
Height: =18
Size: =10
Text: =If(varTooltipLineMulIdx > 0, Index(colLineMulData, varTooltipLineMulIdx).month, "")
Width: =108
X: =8
Y: =5
- imgTooltipLineMulDot1:
Control: Image@2.2.3
Properties:
Fill: =RGBA(59, 130, 246, 1)
Height: =8
Image: =Blank()
RadiusBottomLeft: =4
RadiusBottomRight: =4
RadiusTopLeft: =4
RadiusTopRight: =4
Width: =3
X: =8
Y: =28
- lblTooltipLineMulVal1:
Control: Label@2.5.1
Properties:
Color: =RGBA(15, 23, 42, 1)
Font: =Font.'Open Sans'
FontWeight: =FontWeight.Semibold
Height: =18
Size: =11
Text: =If(varTooltipLineMulIdx > 0, Text(Index(colLineMulData, varTooltipLineMulIdx).Category1), "")
Width: =98
X: =16
Y: =26
- imgTooltipLineMulDot2:
Control: Image@2.2.3
Properties:
Fill: =RGBA(168, 85, 247, 1)
Height: =8
Image: =Blank()
RadiusBottomLeft: =4
RadiusBottomRight: =4
RadiusTopLeft: =4
RadiusTopRight: =4
Width: =3
X: =8
Y: =48
- lblTooltipLineMulVal2:
Control: Label@2.5.1
Properties:
Color: =RGBA(15, 23, 42, 1)
Font: =Font.'Open Sans'
FontWeight: =FontWeight.Semibold
Height: =18
Size: =11
Text: =If(varTooltipLineMulIdx > 0, Text(Index(colLineMulData, varTooltipLineMulIdx).Category2), "")
Width: =98
X: =16
Y: =46
- rectLineMulFooter:
Control: Rectangle@2.3.0
Properties:
Fill: =RGBA(226, 232, 240, 1)
Height: =1
Width: =440
X: =0
Y: =252
- lblLineMulTrend:
Control: Label@2.5.1
Properties:
Color: =RGBA(15, 23, 42, 1)
Font: =Font.'Open Sans'
FontWeight: =FontWeight.Semibold
Height: =20
Size: =12
Text: ="Trending up by 5.2% this month"
Width: =400
X: =20
Y: =262
- lblLineMulDateRange:
Control: Label@2.5.1
Properties:
Color: =RGBA(100, 116, 139, 1)
Font: =Font.'Open Sans'
Height: =20
Size: =11
Text: ="Showing total visitors for the last 6 months"
Width: =400
X: =20
Y: =286Implementation
Copies the customized component code directly to your clipboard. Use Ctrl+V in Power Apps Studio.
Something not pasting right? Troubleshooting guide