comparison d3s_examples/python-neo4jrestclient/static/platin/lib/excanvas/testcases/gradient2.html @ 8:18ef6948d689

new d3s examples
author Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
date Thu, 01 Oct 2015 17:17:27 +0200
parents
children
comparison
equal deleted inserted replaced
7:45dad9e38c82 8:18ef6948d689
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Gradient Test</title>
5 <style>
6
7 body {
8 text-align: center
9 }
10
11 </style>
12 <!--[if IE]><script type="text/javascript" src="../excanvas.js"></script><![endif]-->
13 <script>
14
15 window.onload = function() {
16 var ctx = document.getElementById('c').getContext('2d');
17
18 var g1 = ctx.createLinearGradient(0, 0, 300, 200);
19 g1.addColorStop(0.0, 'rgba(0, 255, 0, 0.0)');
20 g1.addColorStop(1.0, 'rgba(0, 255, 0, 1.0)');
21
22 var g2 = ctx.createLinearGradient(0, 0, 300, 200);
23 g2.addColorStop(0.0, 'rgba(0, 255, 0, 1.0)');
24 // VML Bug
25 g2.addColorStop(1.0, 'rgba(0, 0, 0, 0.0)');
26 ctx.fillStyle = g1;
27 ctx.fillRect(0, 0, 300, 100);
28 ctx.fillStyle = g2;
29 ctx.fillRect(0, 100, 300, 100);
30 };
31
32 </script>
33 </head>
34 <body>
35
36 <canvas id=c width=300 height=200></canvas>
37
38 <p>This tests gradients</p>
39
40 </body>
41 </html>