changxin commited on
Commit
b3cac79
1 Parent(s): 2288352

Update wps-test/ui/chartjs.html

Browse files
Files changed (1) hide show
  1. wps-test/ui/chartjs.html +3 -1
wps-test/ui/chartjs.html CHANGED
@@ -5,6 +5,8 @@
5
  <div style="width:600px;height:500px;margin:auto">
6
  <canvas id="myChart" width="400" height="300"></canvas>
7
  </div>
 
 
8
  <script>
9
  const ctx = document.getElementById('myChart');
10
  const myChart = new Chart(ctx, {type: 'bar',
@@ -21,6 +23,6 @@ const myChart = new Chart(ctx, {type: 'bar',
21
  <script>
22
  function fx(){
23
  var a=canvas.get(0).toDataURL();
24
- alert(a)
25
  }
26
  </script>
 
5
  <div style="width:600px;height:500px;margin:auto">
6
  <canvas id="myChart" width="400" height="300"></canvas>
7
  </div>
8
+ <button onclick="fx()">转为base64资源</button>
9
+ <p></p>
10
  <script>
11
  const ctx = document.getElementById('myChart');
12
  const myChart = new Chart(ctx, {type: 'bar',
 
23
  <script>
24
  function fx(){
25
  var a=canvas.get(0).toDataURL();
26
+ document.getElementsByTagName('p')[0].innerText=a
27
  }
28
  </script>