Echars基本用法代码

本文介绍了如何使用Echarts库创建一个饼图,包括初始化Echarts实例、设置配置项如标题、提示、图例、工具箱等,并展示了具体的饼图数据。通过这个例子,读者可以了解Echarts的基本用法。
摘要由CSDN通过智能技术生成

var myChart;
$(function () {
// 基于准备好的dom,初始化echarts实例,获取的是html中的id
myChart = echarts.init(document.getElementById(‘main’));
// 指定图表的配置项和数据
var option1 = {
title : {
text: ‘阶段说明’,
x:‘center’
},
tooltip : {
trigger: ‘item’,
formatter: “{a}
{b} : {c} ({d}%)”
},
legend: {
orient : ‘vertical’,
x : ‘left’,
data:[‘前期’,‘中期’,‘后期’]
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
magicType : {
show: true,
type: [‘pie’, ‘funnel’],
option: {
funnel: {
x: ‘25%’,
width: ‘50%’,
funnelAlign: ‘left’,
max: 1548
}
}
},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
series :

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值