Def.RadialGradient¶
Generates a reusable <radialGradient> definition
| Name | Type | Required | Description |
|---|---|---|---|
| defId | STRING | The unique identifier for the gradient | |
| stops | STRING | Concatenated list of one or more DaxLib.SVG.Def.GradientStop elements |
|
| cx | STRING | Center X position | |
| cy | STRING | Center Y position | |
| r | STRING | Radius | |
| fx | STRING | Focus X position | |
| fy | STRING | Focus Y position | |
| fr | STRING | Focus radius |
STRING <radialGradient> definition
DaxLib.SVG.SVG(
500, // width
100, // height
"0 0 100 20", // viewbox
DaxLib.SVG.Element.Defs(
DaxLib.SVG.Def.RadialGradient(
"myGradient", // id
DaxLib.SVG.Def.GradientStop(
"10%", // offset
DaxLib.SVG.Colour.Theme(
"Power BI",
25
), // colour
BLANK() // opacity
) &
DaxLib.SVG.Def.GradientStop(
"80%", // offset
DaxLib.SVG.Colour.Theme(
"Power BI",
26
), // colour
0.5 // opacity
) &
DaxLib.SVG.Def.GradientStop(
"95%", // offset
DaxLib.SVG.Colour.Theme(
"Power BI",
27
), // colour
BLANK() // opacity
), // stops
BLANK(), // cx
BLANK(), // cy
BLANK(), // r
BLANK(), // fx
BLANK(), // fy
BLANK() // fr
)
) &
DaxLib.SVG.Element.Circle(
"50%", // cx
"50%", // cy
15, // r
DaxLib.SVG.Attr.Shapes(
"url(""" & "#myGradient" & """)", // fill
BLANK(), // fillOpacity
BLANK(), // fillRule
BLANK(), // stroke
BLANK(), // strokeWidth
BLANK(), // strokeOpacity
BLANK() // opacity
), // attributes
BLANK() // transforms
), // contents
BLANK() // sortODer
)
function 'DaxLib.SVG.Def.RadialGradient' =
(
defId: STRING,
stops: STRING,
cx: STRING,
cy: STRING,
r: STRING,
fx: STRING,
fy: STRING,
fr: STRING
) =>
"<radialGradient" &
" id='" & defId & "'" &
IF( NOT ISBLANK( cx ), " cx='" & cx & "'" ) &
IF( NOT ISBLANK( cy ), " cy='" & cy & "'" ) &
IF( NOT ISBLANK( r ), " r='" & r & "'" ) &
IF( NOT ISBLANK( fx ), " fx='" & fx & "'" ) &
IF( NOT ISBLANK( fy ), " fy='" & fy & "'" ) &
IF( NOT ISBLANK( fr ), " fr='" & fr & "'" ) &
">" &
stops &
"</radialGradient>"