File size: 1,838 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
<!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.charts.Pie.stroke set asFunc</title>
  <link href="https://playground.anychart.com/api/charts/_samples/anychart.charts.Pie.stroke_set_asFunc/iframe" rel="canonical">
  <meta content="Circle Chart,Pie Chart" 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 chart = anychart.pie([
        {x: 'Cycling', value: 12},
        {x: 'Swimming', value: 14},
        {x: 'Run', value: 8},
        {x: 'Hiking', value: 12},
        {x: 'Alpinism', value: 20}
    ]);

    // Set stroke.
    chart.stroke(function () {
        return anychart.color.setThickness(anychart.color.darken(this.sourceColor), 3);
    });

    chart.title('Set chart stroke parameters as a function');
    chart.container('container');
    chart.draw();
});</script>
 </body>
</html>