File size: 2,557 Bytes
7b52e07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta content="IE=edge" http-equiv="X-UA-Compatible">
  <meta content="width=device-width, initial-scale=1" name="viewport">
  <title>anychart.core.cartesian.series.Box.hatchFill get</title>
  <link href="https://playground.anychart.com/api/core/cartesian/series/_samples/anychart.core.cartesian.series.Box.hatchFill_get/iframe" rel="canonical">
  <meta content="Box Chart,Box and Whisker Plot,Statistical Data" name="keywords">
  <meta content="AnyChart - JavaScript Charts designed to be embedded and integrated" name="description">
  <!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
  <link href="_deps/cdn.anychart.com/releases/8.14.1/css/anychart-ui.min.css" rel="stylesheet" type="text/css">
  <style>html, body, #container {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}</style>
 </head>
 <body>
  <div id="container"></div>
  <script src="_deps/cdn.anychart.com/releases/8.14.1/js/anychart-base.min.js"></script>
  <script src="_deps/cdn.anychart.com/releases/8.14.1/js/anychart-exports.min.js"></script>
  <script src="_deps/cdn.anychart.com/releases/8.14.1/js/anychart-ui.min.js"></script>
  <script type="text/javascript">anychart.onDocumentReady(function () {
    var data1 = [
        {x: 'January', low: 760, q1: 801, median: 848, q3: 895, high: 965},
        {x: 'February', low: 733, q1: 853, median: 939, q3: 980, high: 1080, outliers: [1120, 630]},
        {x: 'March', low: 760, q1: 801, median: 848, q3: 895, high: 965, outliers: [650]},
        {x: 'April', low: 724, q1: 802, median: 806, q3: 871, high: 950, outliers: [1000, 600]}
    ];

    var data2 = [
        {x: 'January', low: 660, q1: 801, median: 948, q3: 995, high: 1065},
        {x: 'February', low: 633, q1: 853, median: 1039, q3: 1080, high: 1180, outliers: [1120, 630]},
        {x: 'March', low: 660, q1: 801, median: 948, q3: 995, high: 1065, outliers: [650]},
        {x: 'April', low: 624, q1: 802, median: 906, q3: 971, high: 1050, outliers: [1000, 600]}
    ];

    var chart = anychart.box();

    var series = chart.box(data1);
    series.hatchFill('zig-zag');

    // Get series hatch fill.
    var hatchFill = series.hatchFill();

    var boxSeries = chart.box(data2);
    boxSeries.hatchFill(hatchFill);

    chart.title('Get and use hatch fill');
    chart.container('container');
    chart.draw();
});</script>
 </body>
</html>