JavaScript销售经理能力分析echarts(标记点、标记线)

echarts.js下载链接 提取码:7gagicon-default.png?t=M276https://pan.baidu.com/s/1XwM6UJV3FK0nkxDxwEoR3w?pwd=7gag

根据以下数据实现图标,设置标记点标记线

王斌刘倩袁波
销售87.59092.5
沟通87.588.7591.25
服务908588.75
协作91.2587.592.5
培训8588.7591.25
组织87.591.2588.75

代码

<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<script src="echarts.js"></script>
</head>

<body>
	<div id="main" style="width: 900px; height: 600px"></div>
	<script type="text/javascript">
		var myChart = echarts.init(document.getElementById("main"));
        mytextStyle = {
            color: "red",
            fontWeight: "bolder",
            fontSize: 20,
        };
		var option = {
            title:{
                show:true,
                text:'销售经理能力对比分析',
                textStyle: mytextStyle,
                left:'center',
            },
            legend:{
                data: ['王斌', '刘倩','袁波'],
                itemGap: 5,
                left:'5%',
                itemGap:20
            },
			tooltip: {
				trigger: 'axis',
				axisPointer:
				{
					type: 'shadow',
					lineStyle: {
						color: '#48b', width: 2, type: 'solid'
					},
					crossStyle: {
						color: '#1e90ff', width: 1, type: 'dashed'
					},
					shadowStyle: {
						color: 'rgba(150,150,150,0.2)', width: 'auto', type: 'default'
					}
				},
				showDelay: 0, hideDelay: 0, transitionDuration: 0,
				backgroundColor: 'rgba(0,222,0,0.5)',
				borderColor: '#f50', borderRadius: 8, borderWidth: 2,
				padding: 10,
				position: function (p) {
					return [p[0] + 10, p[1] - 10];
				},
				textStyle: {
					color: 'blue', decoration: 'none', fontFamily: 'sans-serif',
					fontSize: 15, fontStyle: 'normal', fontWeight: 'bold'
				},
				formatter: function (params, ticket, callback) {
					console.log(params)
					var res = '详情提示框 : <br/>' + params[0].name;
					for (var i = 0, l = params.length; i < l; i++) {
						res += '<br/>' + params[i].seriesName + ' : ' + params[i].value;
					}
					setTimeout(function () {
						callback(ticket, res);
					}, 500)
					return 'loading';
				}
			},
			toolbox: {
				show: true,
                left:'70%',
				feature: {
					mark: { show: true }, dataView: { show: true, readOnly: false },
					magicType: { show: true, type: ['line', 'bar', 'stack', 'tiled'] },
					restore: { show: true }, saveAsImage: { show: true }
				}
			},
			calculable: true,
			xAxis: {
				data: ['销售','沟通','服务','协作','培训','组织']
			},
			yAxis: {
				type: 'value'
			},
			series: [
				{
					name: '王斌', type: 'bar',
					data: [87.5,87.5,90,91.25,85,87.5],
                    markPoint:{
                        data:[
                        {
							type: 'min', name: '最小值', symbol: 'arrow', symbolSize: 20,
							itemStyle: {
								normal: { color: 'blue' }
							},
						},
                        ]
                    },
                    markLine: {
					data: [
						{
							type: 'average', name: '平均值',
							itemStyle:
							{
								normal: { borderType: 'dotted', color: 'darkred' }
							},
						}],
				}
				},
				{
					name: '刘倩', type: 'bar',
					data: [90,88.75,85,87.5,88.75,91.25],
                    markPoint:{
                        data:[
                        {
							type: 'min', name: '最小值', symbol: 'arrow', symbolSize: 20,
							itemStyle: {
								normal: { color: 'blue' }
							},
						},
                        ]
                    },
                    markLine: {
					data: [
						{
							type: 'average', name: '平均值',
							itemStyle:
							{
								normal: { borderType: 'dotted', color: 'darkred' }
							},
						}],
				}
				},
				{
					name: '袁波', type: 'bar',
					data: [92.5,91.25,88.75,92.5,91.25,88.75],
                    markPoint:{
                        data:[
                        {
							type: 'max', name: '最大值', symbol: 'diamond', symbolSize: 25,
							itemStyle: {
								normal: { color: 'red' }
							},
						},
                        ]
                    },
                    markLine: {
					data: [
						{
							type: 'average', name: '平均值',
							itemStyle:
							{
								normal: { borderType: 'dotted', color: 'darkred' }
							},
						}],
				}
				},
			]
		};
		myChart.setOption(option); 
	</script>
</body>

</html>

效果图

 

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

EBYB

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值