fillString|Object
Defines the fill options of the circle.
Example - setting the Circle fill options
<div id="diagram"></div>
<script>
var diagram = kendo.dataviz.diagram;
function getVisual(data) {
var g = new diagram.Group({
autoSize: true
});
var r = new diagram.Circle({
center: {x: 40, y: 40},
radius: 40
});
g.append(r);
return g;
};
$("#diagram").kendoDiagram({
layout: "tree",
shapes: [{
id: "1",
content: {
text: "Monday"
},
visual: getVisual
}]
});
</script>
fill.colorString
Defines the fill color of the circle.
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
color: "#ff6358"
}
}]
});
</script>
fill.opacityNumber
(default: 1)
Defines the fill opacity of the circle.
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
color: "#ff6358",
opacity: 0.5
}
}]
});
</script>
fill.gradientObject
Defines the gradient fill of the shape.
Example - setting a gradient fill
<div id="diagram"></div>
<script>
var diagram = kendo.dataviz.diagram;
function getVisual(data) {
var g = new diagram.Group({
autoSize: true
});
var r = new diagram.Circle({
center: {x: 40, y: 40},
radius: 40,
fill: {
gradient: {
type: "linear",
stops: [{
color: "green",
offset: 0,
opacity: 0.5
}, {
color: "yellow",
offset: 1,
opacity: 1
}]
}
}
});
g.append(r);
return g;
};
$("#diagram").kendoDiagram({
layout: "tree",
shapes: [{
id: "1",
content: {
text: "Monday"
},
visual: getVisual
}]
});
</script>
fill.gradient.typeString
(default: "linear")
The type of the gradient. Supported values are:
- linear
- radial
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
gradient: {
type: "radial",
stops: [
{ color: "#ff6358", offset: 0 },
{ color: "#ffd246", offset: 1 }
]
}
}
}]
});
</script>
fill.gradient.centerArray
The center of the radial gradient.
Coordinates are relative to the shape bounding box. For example [0, 0] is top left and [1, 1] is bottom right.
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
gradient: {
type: "radial",
center: [0.5, 0.3],
stops: [
{ color: "#ff6358", offset: 0 },
{ color: "#ffd246", offset: 1 }
]
}
}
}]
});
</script>
fill.gradient.radiusNumber
(default: 1)
The radius of the radial gradient relative to the shape bounding box.
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
gradient: {
type: "radial",
radius: 0.8,
stops: [
{ color: "#ff6358", offset: 0 },
{ color: "#ffd246", offset: 1 }
]
}
}
}]
});
</script>
fill.gradient.startArray
The start point of the linear gradient.
Coordinates are relative to the shape bounding box. For example [0, 0] is top left and [1, 1] is bottom right.
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
gradient: {
type: "linear",
start: [0, 0],
end: [1, 1],
stops: [
{ color: "#ff6358", offset: 0 },
{ color: "#ffd246", offset: 1 }
]
}
}
}]
});
</script>
fill.gradient.endArray
The end point of the linear gradient.
Coordinates are relative to the shape bounding box. For example [0, 0] is top left and [1, 1] is bottom right.
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
gradient: {
type: "linear",
start: [0, 0],
end: [0.8, 0.8],
stops: [
{ color: "#ff6358", offset: 0 },
{ color: "#ffd246", offset: 1 }
]
}
}
}]
});
</script>
fill.gradient.stopsArray
The array of gradient color stops.
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
gradient: {
type: "linear",
stops: [
{ color: "#ff6358", offset: 0, opacity: 1 },
{ color: "#ffd246", offset: 0.5, opacity: 0.8 },
{ color: "#28b4c8", offset: 1, opacity: 0.6 }
]
}
}
}]
});
</script>
fill.gradient.stops.offsetNumber
The stop offset from the start of the element. Ranges from 0 (start of gradient) to 1 (end of gradient).
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
gradient: {
type: "linear",
stops: [
{ color: "#ff6358", offset: 0 },
{ color: "#ffd246", offset: 0.3 },
{ color: "#28b4c8", offset: 1 }
]
}
}
}]
});
</script>
fill.gradient.stops.colorString
The color in any of the following formats.
| Format | Description | --- | --- | --- | red | Basic or Extended CSS Color name | #ff0000 | Hex RGB value | rgb(255, 0, 0) | RGB value
Specifying 'none', 'transparent' or '' (empty string) will clear the fill.
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
gradient: {
type: "linear",
stops: [
{ color: "red", offset: 0 },
{ color: "#ff6358", offset: 0.5 },
{ color: "rgb(40, 180, 200)", offset: 1 }
]
}
}
}]
});
</script>
fill.gradient.stops.opacityNumber
The fill opacity. Ranges from 0 (completely transparent) to 1 (completely opaque).
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [{
type: "circle",
x: 100,
y: 100,
fill: {
gradient: {
type: "linear",
stops: [
{ color: "#ff6358", offset: 0, opacity: 1 },
{ color: "#ffd246", offset: 0.5, opacity: 0.5 },
{ color: "#28b4c8", offset: 1, opacity: 0.2 }
]
}
}
}]
});
</script>