文本
调试运行
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>图形展示</title>
</head>
<body>
<div class="detail-section">
<div id="canvas">
</div>
</div>
<script src="http://g.tbcdn.cn/bui/acharts/1.0.32/acharts-min.js"></script>
<!-- https://g.alicdn.com/bui/acharts/1.0.29/acharts-min.js -->
<script type="text/javascript">
//创建画板
var canvas = new AChart.Canvas({
id : 'canvas',
height : 400,
width : 500
});
//基本的文本
var text = canvas.addShape('text',{
text : 'hello !!!\n你好',
x : 100,
y : 100,
fill : 'red',
'font-size':16,
'font-weight' : 'bold'
});
//支持平移、旋转
var label = canvas.addShape('label',{
text : 'hello !!!\n你好',
x : 150,
y : 100,
rotate : 90,
fill : 'blue',
'font-size':16,
'font-weight' : 'bold'
});
</script>
</body>
</html>