You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.7 KiB
75 lines
2.7 KiB
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>ECharts</title>
|
|
<!-- 引入刚刚下载的 ECharts 文件 -->
|
|
<script src="js/echarts.js"></script>
|
|
</head>
|
|
<body>
|
|
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
|
|
<div id="main" style="width: 600px;height:400px;"></div>
|
|
|
|
<script type="text/javascript">
|
|
var postDataSet = {
|
|
"dimensions": [
|
|
"reportDate",
|
|
"销售商品收到的现金",
|
|
"收到其他与经营活动有关的现金"
|
|
],
|
|
"source": [
|
|
{
|
|
"reportDate": "2023-01-01",
|
|
"销售商品收到的现金": 123123.21,
|
|
"收到其他与经营活动有关的现金": 23554.43
|
|
},
|
|
{
|
|
"reportDate": "2023-01-02",
|
|
"销售商品收到的现金": 235553.23,
|
|
"收到其他与经营活动有关的现金": 234323.11
|
|
},
|
|
{
|
|
"reportDate": "2023-01-03",
|
|
"销售商品收到的现金": 347534.13,
|
|
"收到其他与经营活动有关的现金": 234234.11
|
|
},
|
|
{
|
|
"reportDate": "2023-01-04",
|
|
"销售商品收到的现金": 346532.21,
|
|
"收到其他与经营活动有关的现金": 234342.11
|
|
},
|
|
{
|
|
"reportDate": "2023-01-05",
|
|
"销售商品收到的现金": 345354.23,
|
|
"收到其他与经营活动有关的现金": 213123.11
|
|
},
|
|
{
|
|
"reportDate": "2023-01-06",
|
|
"销售商品收到的现金": 543266.23,
|
|
"收到其他与经营活动有关的现金": 34234.11
|
|
},
|
|
{
|
|
"reportDate": "2023-01-07",
|
|
"销售商品收到的现金": 564365.23,
|
|
"收到其他与经营活动有关的现金": 234342.11
|
|
}
|
|
]
|
|
};
|
|
// 基于准备好的dom,初始化echarts实例
|
|
var myChart = echarts.init(document.getElementById('main'));
|
|
// 指定图表的配置项和数据
|
|
var option = {
|
|
legend: {},
|
|
tooltip: {},
|
|
dataset: postDataSet,
|
|
xAxis: { type: 'category' },
|
|
yAxis: {},
|
|
// Declare several bar series, each will be mapped
|
|
// to a column of dataset.source by default.
|
|
series: [{ type: 'bar' }, { type: 'bar' }]
|
|
};
|
|
// 使用刚指定的配置项和数据显示图表。
|
|
myChart.setOption(option);
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|