asp.net 用Echart的範例
from https://chat.openai.com/chat
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>ECharts in ASP.NET</title>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js"></script>
</head>
<body>
<div id="chart" style="width: 800px; height: 600px;"></div>
<script>
// 创建一个 ECharts 实例
var myChart = echarts.init(document.getElementById('chart'));
// 配置图表的参数
var option = {
title: {
text: '销售数据'
},
tooltip: {},
legend: {
data: ['销量']
},
xAxis: {
data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
},
yAxis: {},
series: [{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}]
};
// 使用 ECharts 绘制图表
myChart.setOption(option);
</script>
</body>
</html>
留言
張貼留言