| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 | import Chart from "../../../src/chart/bar/ChartBar23/ChartBar23";
import Tooltip from '../../../src/chart/commonOptions/tooltip';
let bar = new Chart(document.querySelector(".c1"), {});
window.addEventListener("resize", function () {
    bar.resize()
});
setTimeout(()=>{
    console.log(6000);
    // bar.setOption(opt);
},6000)
const opt = {
    color: ["#0054ff", "#cb703d"],
    bg: {
        backgroundColor: '#0b0c0e'
    },
    grid:  {
        left:'18%',
        top:'20%',
        right:'18%',
        bottom:'18%',
        containLabel: false
    },
    legend: {
        left: "18%",
        top: '6%',
        itemHeight: 12,
        itemWidth: 12,
        itemAngelR: 0,
        textStyle: {
            fontSize: 16,
            color: '#ffffff'
        }
    },
    tooltip: {
        titleColor: '#ffffff',
        bgStyle: {
            borderColor: 'rgba(255,255,255,0.1)',
            borderWidth: 2,
            backgroundColor: '#000000',
        },
        tooltipText: Tooltip.option.tooltipText
    },
    xAxis: {
        type: "category",
        name: '年份',
        nameTextStyle: {
            fontSize: 12,
            color: '#ffffff',
        },
        namePosition: 'end',
        axisLine: {
            show: true,
            lineStyle: {
                color: 'rgba(255,255,255,0.1)',
                width: 2,
                type: 'solid'
            }
        },
        axisTick: {
            show: true,
            alignWithLabel: true,
            length: 2,
            lineStyle: {
                color: '#ffffff',
            }
        },
        splitLine: {
            show: false,
        },
        axisLabel: {
            show: true,
            maxShow:'',
            overHidden:true ,
            textStyle: {
                fontSize:12,
                fontWeight:'normal',
                color: '#ffffff'
            }
        },
        highLightColor: 'rgba(255,255,255,0.5)',
        data: ['2014', '2015', '2016', '2017', '2018', '2019'],
    },
    yAxis: {
        type: 'value',
        nameTextStyle: {
            color: '#ffffff',
            fontSize: 14
        },
        axisLine: {
            show: true,
            lineStyle: {
                color: '#ffffff',
                width: 1,
            }
        },
        axisTick: {
            show: true,
            lineStyle: {
                color: '#ffffff',
            },
            length: 2,
            alignWithLabel: true
        },
        splitLine: {
            show: false
        },
        axisLabel: {
            textStyle: {
                color: '#ffffff'
            }
        },
    },
    shape: {
        barGap: '30%',
        barCategoryGap: '40%',
    },
    series: [{
        name: '类别一',
        data: [1550, 1550, 1550, 1550, 1550, 1550]
    }, {
        name: '类别二',
        type: 'bar',
        data: [1550, 1550, 1550, 1550, 1550, 1550]
    }
    ]
};
 |