HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
var stage = anychart.graphics.create('container');
3
4
var pattern = stage.pattern(new anychart.graphics.math.Rect(0, 0, 20, 20));
5
pattern.star5(10, 10, 8).stroke('#fffaf0');
6
7
var chart = anychart.bubble();
8
9
var series = chart.bubble([
10
{x: 1, value: 1.0, size: 2},
11
{x: 2, value: 1.6, size: -7},
12
{x: 3, value: 1.2, size: -4},
13
{x: 4, value: 1.9, size: 3},
14
{x: 4, value: 1.5, size: -2}
15
]);
16
17
series.displayNegative(true);
18
19
var state = series.normal();
20
21
// Set negative hatch fill.
22
state.negativeHatchFill(pattern);
23
24
chart.title('Set state hatch fill as a pattern');
25
chart.container(stage);
26
chart.draw();
27
});