Playing around with SVG

This commit is contained in:
2017-07-07 02:37:43 +02:00
parent 8c438ba08b
commit a80266358d
4 changed files with 32 additions and 25 deletions

View File

@ -1,19 +1,14 @@
component Statistics(screenSizes []*utils.AnalyticsItem)
component Statistics(screenSizes []*utils.PieChartSlice)
h1 Statistics
.statistics
h3 Screen size
PieChart
PieChart(screenSizes)
//- canvas#screen-sizes.graph(data-values=utils.ToJSON(screenSizes))
component PieChart
component PieChart(slices []*utils.PieChartSlice)
svg.graph(viewBox="-1.05 -1.05 2.1 2.1")
g
title Demo (50%)
path.slice.slice-1(d=utils.SVGSlicePath(0, 0.5))
g
title Demo (30%)
path.slice.slice-2(d=utils.SVGSlicePath(0.5, 0.8))
g
title Demo (20%)
path.slice.slice-3(d=utils.SVGSlicePath(0.8, 1.0))
each slice in slices
g
title= slice.Title
path.slice(d=utils.SVGSlicePath(slice.From, slice.To), fill=slice.Color)