Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body id="app">
  <div class="ctrlPanel">
    <div>
      SVG 寬度: <input type="text" v-model="width">
    </div>
    <div>
      SVG 高度: <input type="text" v-model="height">  
    </div>
    <div>
      bar 1 數值: <input type="text" v-model="dataset[0]">  
    </div>
  </div>
  
  <div>
    <svg v-bind:width="width" v-bind:height="height">
      <rect
        v-for="data in dataset"
        v-bind:x="barXOffset"
        v-bind:y="$index * 32"
        v-bind:width="data * 10"
        v-bind:height="barHeight"
        v-bind:fill="barColor">
      </rect>
    </svg>
  </div><!--#app-->
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
winwupro
0viewers