-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Labels
Description
Is it possible to use a gradient fill instead of a single colour?
var def = svg.append('defs');
var gradient = def.append('linearGradient')
.attr('id', 'custom_id_1')
.attr('x1', '50%')
.attr('y1', '0%')
.attr('x2', '50%')
.attr('y2', '100%');
//set start
gradient.append('stop')
.attr('offset', '0%')
.attr('stop-color', 'white')
//set color at the end
gradient.append('stop')
.attr('offset', '100%')
.attr('stop-color', 'blue')
var t = textures
.lines()
.shapeRendering("crispEdges")
.background('url(#custom_id_1)');
var t = textures
.lines()
.shapeRendering("crispEdges")
.stroke('url(#custom_id_1)');
Reactions are currently unavailable

