Getting Started
<canvas id="myChart"></canvas><!-- online -->
<script src="https://gw.alipayobjects.com/os/antv/assets/f2/3.2.3/f2.js"></script>// Any of the following formats may be used, just choose one!
const chart = new F2.Chart({
id: 'myChart', // pass node's id
width: 375,
height: 260,
pixelRatio: window.devicePixelRatio
});
const chart = new F2.Chart({
el: document.getElementById('myChart'), // or pass node
width: 375,
height: 260,
pixelRatio: window.devicePixelRatio
});
const chart = new F2.Chart({
context: document.getElementById('myChart').getContext('2d'), // or pass 2d context of the canvas
width: 375,
height: 260,
pixelRatio: window.devicePixelRatio
});

Last updated