用hbuilder玫瑰花代码
时间: 2024-02-01 07:03:33 浏览: 127
根据提供的引用内容,您可以使用以下代码在 HBuilder 中绘制玫瑰花图表:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://cdn.bootcss.com/echarts/4.8.0/echarts.js"></script>
<title></title>
</head>
<body>
<div id="main" style="width: 600px;height: 600px;"></div>
<script type="text/javascript">
var myChart=echarts.init(document.getElementById("main"));
var option={
series:[
{
name:'玫瑰花',
type:'pie',
radius:['35%','60%'],
center:['50%','40%'],
clockWise:true,
roseType: 'radius',
data:[
{value:60,name:'生活方式'},
{value:15,name:'遗传因素'},
{value:10,name:'社会因素'},
{value:20,name:'医疗条件'},
{value:6,name:'气候环境'}
]
}
]
};
myChart.setOption(option);
</script>
</body>
</html>
```
阅读全文