常用组件的配置

 

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <!--引入ECharts脚本-->
    <script src="echarts.min.js"></script>
</head>

<body>
    <!---为ECharts准备一个具备大小(宽高)的DOM-->
    <div id="main" style="width: 900px; height: 600px"></div>
    <script type="text/javascript">
        //基于准备好的DOM,初始化ECharts图表
        var myChart = echarts.init(document.getElementById("main"));
        //指定图表的配置项和数据
        var option = {
            tooltip: {  //配置提示框组件
                trigger: 'axis',
                axisPointer:
                {
                    type: 'shadow',
                    lineStyle: {
                        color: '#48b', width: 2, type: 'solid'
                    },
                    crossStyle: {
                        color: '#0000ff', width: 1, type: 'dashed'
                    },
                    shadowStyle: {
                        color: 'rgba(999,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) {
                    //位置回调
                    //console.log && console.log(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;

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值