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 chart = anychart.bubble();
3
4
var series = chart.bubble([
5
{x: 1, value: 1.0, size: 2},
6
{x: 2, value: 1.6, size: -7},
7
{x: 3, value: 1.2, size: -4},
8
{x: 4, value: 1.9, size: 3},
9
{x: 4, value: 1.5, size: -2}
10
]);
11
12
series.displayNegative(true);
13
14
var state = series.normal();
15
16
// Set negative hatch fill.
17
state.negativeHatchFill(function(){
18
if (this.value < 1.4) {
19
return {type: 'backward-diagonal', color: '#FFFFFF', thickness: 3};
20
}
21
});
22
23
chart.title('Set state hatch fill parameter as a function');
24
chart.container('container');
25
chart.draw();
26
});