Built with blockbuilder.org
xxxxxxxxxx
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,height=device-height">
<title>基础折线图</title>
<style>::-webkit-scrollbar{display:none;}html,body{overflow:hidden;height:100%;}</style>
</head>
<body>
<div id="mountNode"></div>
<script>/*Fixing iframe window.innerHeight 0 issue in Safari*/document.body.clientHeight;</script>
<script src="https://gw.alipayobjects.com/os/antv/assets/g2/3.0.4/g2.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/data-set/0.8.5/data-set.min.js"></script>
<script src="params.js"></script>
<script src="data.js"></script>
<script>
G2.track(false);
const chart = new G2.Chart({
container: 'mountNode',
forceFit: true,
height: window.innerHeight,
data: data,
options: params
});
chart.facet('rect',
{fields:['Species'],
eachView: function(view){
view.point()
.position('Sepal.Width*Sepal.Length')
.color("Species")
}
})
/* */
/*
facet.opts.eachView = function(view){
facet.geoms.forEach(function(d){
var v = view[d.type]();
Object.keys(d)
.filter(function(i){ return i != "type"})
.forEach(function(i){
return v[i].apply(v, d[i]);
})
})
}
chart['facet'](facet.type, facet.opts);
*/
chart.render();
</script>
</body>
</html>
https://gw.alipayobjects.com/os/antv/assets/g2/3.0.4/g2.min.js
https://gw.alipayobjects.com/os/antv/assets/data-set/0.8.5/data-set.min.js