123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- import Chart from "../../../src/chart/bar/ChartBar21/ChartBar21";
- // import bar15 from "./ChartBar15_1eba2";
-
- const consoleWarn = window.console.warn;
- window.console.warn = function () {
- const string = arguments[0];
- const filterStrings = [
- 'is not power of two',
- 'image is too big',
- 'marked for update',
- 'can\'t invert matrix'
- ];
- // filter warnings containing above strings
- const shouldBeFiltered = filterStrings.some(string => (
- arguments[0].includes('THREE') && arguments[0].includes(string)
- ));
- if (shouldBeFiltered) {
- // console.log("find",arguments[0])
-
- // log it to console without second argument, which contains reference to `image`
- // consoleWarn.call(null, arguments[0]);
- } else {
- // pass other warnings without changes
- consoleWarn.apply(null, arguments);
- }
- };
- let bar = new Chart(document.querySelector(".c1"), {});
- window.addEventListener("resize", function () {
- bar.resize()
- });
-
-
- let option1 = {
- color: ['#0a73dc', '#04a2ae', '#424a95', '#2a7ebe', '#113b85', '#a2f9ff', '#01a0c8', '#5879c0', '#74e9f2', '#126087', '#99b5da'],
- bg: {
- backgroundColor: "#000000",
- showBgPlane: true,
- bgPlaneColor: '#ffffff',
- borderColor: '#0000ff'
- },
- legend: {
- show: true,
- left: "80%",
- top: '15%',
- orient: 'horizontal',
- itemWidth: 8,
- itemHeight: 8,
- borderRadius: 0,
- textStyle: {
- fontSize: 12,
- color: "#ffffff",
- fontWeight: 'bold'
- }
- },
- tooltip: {
- show: true,
- paddingW: 10,
- paddingH: 10,
- itemGap: 2,
- //距目标的偏移值
- offsetX: 15,
- offsetY: 0,
- titleFontSize: 14,
- titleColor: '#ff0000',
- itemFontSize: 12,
- itemColor: "#ffffff",
- borderColor: '#ccc',
- borderWidth: 0,
- backgroundColor: 'rgba(255,255,255,0)',
-
- },
- grid: {
- left: "20%",
- right: "20",
- top: "20%",
- bottom: "20%"
- },
- shape: {
- faceColor: "#ffffff"
-
- },
- valueAxis: {
- textStyle: {
- fontSize: 12,
- color: "#ffffff",
- shadowBlur: 5,
- shadowColor: "#ff0000"
- }
- },
- categoryAxis: {
- textStyle: {
- fontSize: 14,
- color: "#ffffff",
- shadowBlur: 0,
- shadowColor: "#ffffff"
- },
- data: ["小米", "华为", "苹果", "三星", "vivo", "oppo"]
- },
-
- series: [{
- name: "一季度销量",
- data: [105319, 148671, 457822, 496554, 407788, 368555]
- },
-
- ]
- };
- //
- setTimeout(() => {
- bar.setOption(option1);
- }, 5000);
|