Back to LibraryCharts
Line Chart - Linear
Added Jun 16, 2026
A sharp-edged linear line chart with straight segments between data points, powered by a Power Apps collection.
Dark Mode
Line Chart - Linear
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(colLineChartData, {month: "January", Value: 186}, {month: "February", Value: 305}, {month: "March", Value: 237}, {month: "April", Value: 73}, {month: "May", Value: 209}, {month: "June", Value: 214})
- On your screen's OnVisible, add: Set(varLineLinChartAnimate, true); Set(varTooltipLineIdx, 0)
- Paste the copied YAML into Power Apps Studio (Ctrl+V).
- Click any data point to show a tooltip; click again to dismiss.
- To replay the animation: Set(varLineLinChartAnimate, false); Set(varLineLinChartAnimate, true)
- Replace colLineChartData with any data source that has {month, Value} columns.
Problem Solved
Renders a sharp-edged SVG line chart inside a Power Apps Image control, no external charting library needed.
Integration
Bind colLineChartData to any data source with {month, Value} columns. The chart redraws automatically when the collection changes.
YAML Code
- conLineLinChart:
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:
- tmrLineLinChartAnimate:
Control: Timer@2.0.0
Properties:
Duration: =1200
Height: =1
OnTimerEnd: =Set(varLineLinChartAnimate, false)
Repeat: =false
Start: =varLineLinChartAnimate
Visible: =false
Width: =1
X: =0
Y: =0
- lblLineLinTitle:
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 - Linear"
Width: =400
X: =20
Y: =14
- lblLineLinDescription:
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
- rectLineLinHeaderLine:
Control: Rectangle@2.3.0
Properties:
Fill: =RGBA(226, 232, 240, 1)
Height: =1
Width: =440
X: =0
Y: =68
- imgLineLinChart:
Control: Image@2.2.3
Properties:
Height: =172
Width: =416
X: =12
Y: =72
Image: |-
=With(
{
_n: CountRows(colLineChartData),
_max: Max(1, Max(colLineChartData, Value)),
_slot: Int(400 / Max(1, CountRows(colLineChartData))),
_p: Min(1, tmrLineLinChartAnimate.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'/>" &
"<polyline points='" & Concat(Sequence(_n), Text(Int(8 + (Value-0.5)*_slot)) & "," & Text(Int(152 - Index(colLineChartData, Value).Value/_max*144*_ease)) & " ") & "' fill='none' stroke='#3b82f6' 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(colLineChartData, Value).month, 3) & "</text>"
) &
"</svg>"
)
)
)
- galLineLinInteract:
Control: Gallery@2.15.0
Variant: Horizontal
Properties:
Fill: =RGBA(0, 0, 0, 0)
Height: =152
Items: =Sequence(CountRows(colLineChartData))
ShowScrollbar: =false
TemplatePadding: =0
TemplateSize: =416 / Max(1, CountRows(colLineChartData))
Width: =416
X: =12
Y: =80
Children:
- btnLineLinHit:
Control: Button@0.0.45
Properties:
Appearance: ='ButtonCanvas.Appearance'.Transparent
Height: =Parent.TemplateHeight
OnSelect: =If(varTooltipLineIdx = ThisItem.Value, Set(varTooltipLineIdx, 0), Set(varTooltipLineIdx, ThisItem.Value))
Text: =""
Width: =Parent.TemplateWidth
X: =0
Y: =0
- conLineLinTooltip:
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: =50
RadiusBottomLeft: =8
RadiusBottomRight: =8
RadiusTopLeft: =8
RadiusTopRight: =8
Visible: =varTooltipLineIdx > 0
Width: =110
X: =Max(20, Min(320, 20 + (varTooltipLineIdx - 0.5) * (400 / Max(1, CountRows(colLineChartData))) - 55))
Y: =Max(76, Int(224 - Index(colLineChartData, Max(1, varTooltipLineIdx)).Value / Max(1, Max(colLineChartData, Value)) * 144) - 25)
Children:
- lblTooltipLineLinMonth:
Control: Label@2.5.1
Properties:
Color: =RGBA(100, 116, 139, 1)
Font: =Font.'Open Sans'
Height: =18
Size: =10
Text: =If(varTooltipLineIdx > 0, Index(colLineChartData, varTooltipLineIdx).month, "")
Width: =100
X: =8
Y: =5
- imgTooltipLineLinDot:
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
- lblTooltipLineLinValue:
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(varTooltipLineIdx > 0, Text(Index(colLineChartData, varTooltipLineIdx).Value), "")
Width: =90
X: =16
Y: =26
- rectLineLinFooterLine:
Control: Rectangle@2.3.0
Properties:
Fill: =RGBA(226, 232, 240, 1)
Height: =1
Width: =440
X: =0
Y: =252
- lblLineLinTrend:
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
- lblLineLinDateRange:
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