我想让echarts的dataZoom数据区域选择自动化,让那个滑块受代码控制而移动,而不是靠鼠标拖曳。

落灬梦 发布于 2016/09/14 15:37
阅读 2K+
收藏 0

@一口没水的枯井 你好,想跟你请教个问题:我想让echarts的dataZoom数据区域选择自动化,让那个滑块受代码控制而移动,而不是靠鼠标拖曳。

就是因为x轴标签数据太多,想让他们自己动态循环起来;辛苦了

我的代码如下:

var dataMap = {};
function dataFormatter(obj) {
    var pList = ['秦皇岛电厂','大港电厂','白马电厂','阜康电厂','鄂温克电厂','和丰电厂','河曲电厂','花园电厂'
    ,'焦作电厂','神二电厂','灵州电厂','大南湖电厂','重庆电厂','鸳鸯湖电厂','王曲电厂','府谷电厂',
    '萨拉齐电厂','保德神东发电公司','亿利电厂','店塔电厂','郭家湾电厂','米东电厂',
    '神木电厂','万州电厂','五彩湾电厂','上湾电厂'];
    var temp;
    for (var year = 2; year <= 11; year++) {
        var max = 0;
        var sum = 0;
        temp = obj[year];
        for (var i = 0, l = temp.length; i < l; i++) {
            max = Math.max(max, temp[i]);
            sum += temp[i];
            obj[year][i] = {
                name : pList[i],
                value : temp[i]
            }
        }
        obj[year + 'max'] = Math.floor(max / 100) * 100;
        obj[year + 'sum'] = sum;
    }
    return obj;
}

dataMap.dataGDP = dataFormatter({
    //max : 60000,
    11:[16251.93,11307.28,24515.76,11237.55,14359.88,22226.7,10568.83,12582,
    16251.93,11307.28,24515.76,11237.55,14359.88,22226.7,10568.83,12582,
    16251.93,11307.28,24515.76,11237.55,11307.28,24515.76,11237.55,14359.88,22226.7,10568.83],
    10:[14113.58,9224.46,20394.26,9200.86,11672,18457.27,8667.58,10368.6,
    14113.58,9224.46,20394.26,9200.86,11672,18457.27,8667.58,10368.6,
    14113.58,9224.46,20394.26,9200.86,11672,20394.26,9200.86,11672,18457.27,8667.58],
    9:[12153.03,7521.85,17235.48,7358.31,9740.25,15212.49,7278.75,8587,
    12153.03,7521.85,17235.48,7358.31,9740.25,15212.49,7278.75,8587,
    12153.03,7521.85,17235.48,7358.31,9740.25,17235.48,7358.31,9740.25,15212.49,7278.75],
    8:[11115,6719.01,16011.97,7315.4,8496.2,13668.58,6426.1,8314.37,
    11115,6719.01,16011.97,7315.4,8496.2,13668.58,6426.1,8314.37,
    11115,6719.01,16011.97,7315.4,8496.2,16011.97,7315.4,8496.2,13668.58,6426.1],
    7:[9846.81,5252.76,13607.32,6024.45,6423.18,11164.3,5284.69,7104,
    9846.81,5252.76,13607.32,6024.45,6423.18,11164.3,5284.69,7104,
    9846.81,5252.76,13607.32,6024.45,6423.18,13607.32,6024.45,6423.18,11164.3,5284.69],
    6:[8117.78,4462.74,11467.6,4878.61,4944.25,9304.52,4275.12,6211.8,
    8117.78,4462.74,11467.6,4878.61,4944.25,9304.52,4275.12,6211.8,
    8117.78,4462.74,11467.6,4878.61,4944.25,9304.52,4462.74,11467.6,4878.61,4944.25,9304.52],
    5:[6969.52,3905.64,10012.11,4230.53,3905.03,8047.26,3620.27,5513.7,
    6969.52,3905.64,10012.11,4230.53,3905.03,8047.26,3620.27,5513.7,
    3905.64,10012.11,4230.53,3905.03,8047.26,3620.27,10012.11,4230.53,3905.03,8047.26],
    4:[6033.21,3110.97,8477.63,3571.37,3041.07,6672,3122.01,4750.6,
    6033.21,3110.97,8477.63,3571.37,3041.07,6672,3122.01,4750.6,3110.97,8477.63,3571.37,3041.07,6672,3122.01,
    8477.63,3571.37,3041.07,6672],
    3:[5007.21,2578.03,6921.29,2855.23,2388.38,6002.54,2662.08,4057.4,
    5007.21,2578.03,6921.29,2855.23,2388.38,6002.54,2662.08,4057.4,
    5007.21,2578.03,6921.29,2855.23,2388.38,6002.54,6921.29,2855.23,2388.38,6002.54],
    2:[4315,2150.76,6018.28,2324.8,1940.94,5458.22,2348.54,3637.2,
    4315,2150.76,6018.28,2324.8,1940.94,5458.22,2348.54,3637.2,
    2150.76,6018.28,2324.8,1940.94,5458.22,2324.8,1940.94,5458.22,2348.54,3637.2]
});

dataMap.dataPI = dataFormatter({
    //max : 4000,
    11:[1346.27,1359.72,1305.73,1641.42,1306.3,1515.57,1277.44,1701.5,
    1346.27,1359.72,1305.73,1641.42,1306.3,1515.57,1277.44,1701.5,
    1346.27,1359.72,1305.73,1641.42,1306.3,1515.57,1359.72,1305.73,1641.42,1306.3],
    10:[1324.36,1245.58,1562.81,1554.48,1095.28,1631.08,1050.15,1302.9,
    1324.36,1245.58,1562.81,1554.48,1095.28,1631.08,1050.15,1302.9,
    1245.58,1562.81,1554.48,1095.28,1631.08,1554.48,1095.28,1631.08,1050.15,1302.9],
    09:[1318.29,1228.85,2207.34,1477.59,1329.6,1414.9,1180.57,1154.33,
    1318.29,1228.85,2207.34,1477.59,1329.6,1414.9,1180.57,1154.33,
    2228.85,2207.34,1477.59,1329.6,1414.9,1477.59,1329.6,1414.9,1180.57,1154.33],
    08:[1112.83,1222.58,2034.59,1313.58,1907.95,1302.02,1916.72,1088.94,
    1112.83,1222.58,2034.59,1313.58,1907.95,1302.02,1916.72,1088.94,
    1112.83,1222.58,2034.59,1313.58,1907.95,1302.02,1916.72,1088.94,
    1112.83,1222.58],
    07:[1201.26,1210.19,1804.72,1311.97,1762.1,1133.42,1783.8,1915.38,
    1201.26,1210.19,1804.72,1311.97,1762.1,1133.42,1783.8,1915.38,
    1201.26,1210.19,1804.72,1311.97,1762.1,1133.42,1783.8,1915.38,
    1201.26,1210.19],
    06:[1188.8,1203.35,1461.81,1276.77,1634.94,1939.43,1672.76,1750.14,
    1188.8,1203.35,1461.81,1276.77,1634.94,1939.43,1672.76,1750.14,
    1188.8,1203.35,1461.81,1276.77,1634.94,1939.43,1672.76,1750.14,
    1188.8,1203.35],
    05:[1288.68,1312.38,1400,1262.42,1589.56,1882.41,1625.61,1684.6,
    1288.68,1312.38,1400,1262.42,1589.56,1882.41,1625.61,1684.6,
    1288.68,1312.38,1400,1262.42,1589.56,1882.41,1625.61,1684.6,
    1288.68,1312.38],
    04:[1287.36,1105.28,1370.43,1276.3,1522.8,1798.43,1568.69,1605.79,
    1287.36,1105.28,1370.43,1276.3,1522.8,1798.43,1568.69,1605.79,
    1287.36,1105.28,1370.43,1276.3,1522.8,1798.43,1568.69,1605.79,
    1287.36,1105.28],
    03:[1084.1111,1289.91,1064.05,1215.19,1420.1,1615.8,1488.23,1504.8,
    1084.1111,1289.91,1064.05,1215.19,1420.1,1615.8,1488.23,1504.8,
    1084.1111,1289.91,1064.05,1215.19,1420.1,1615.8,1488.23,1504.8,
    1084.1111],
    02:[1082.44,1084.21,1956.84,1297.8,1374.69,1590.2,1446.17,1474.2,
    1082.44,1084.21,1956.84,1297.8,1374.69,1590.2,1446.17,1474.2,
    1082.44,1084.21,1956.84,1297.8,1374.69,1590.2,1446.17,1474.2,
    1082.44,1084.21]
});

dataMap.dataSI = dataFormatter({
    //max : 26600,
    11:[1752.48,1928.32,1126.86,1635.26,2037.69,1252.15,1611.48,1962.41,
    1752.48,1928.32,1126.86,1635.26,2037.69,1252.15,1611.48,1962.41,
    1752.48,1928.32,1126.86,1635.26,2037.69,1252.15,1611.48,1962.41,
    1752.48,1928.32],
    10:[1388.38,1840.23,1077.68,1234,1367.69,1976.82,1506.31,1025.15,
    1388.38,1840.23,1077.68,1234,1367.69,1976.82,1506.31,1025.15,
    1388.38,1840.23,1077.68,1234,1367.69,1976.82,1506.31,1025.15,
    1388.38,1840.23],
    09:[1855.55,1987.84,1959.83,1993.8,1114,1906.34,1541.92,2060.72,
    1855.55,1987.84,1959.83,1993.8,1114,1906.34,1541.92,2060.72,
    1855.55,1987.84,1959.83,1993.8,1114,1906.34,1541.92,2060.72,
    1855.55,1987.84],
    08:[1626.41,1709.78,1701.34,1242.36,1376.19,1158.84,2097.12,1319.75,
    1626.41,1709.78,1701.34,1242.36,1376.19,1158.84,2097.12,1319.75,
    1626.41,1709.78,1701.34,1242.36,1376.19,1158.84,2097.12,1319.75,
    1626.41,1709.78],
    07:[1509.4,1892.53,1201.88,1454.49,2193.67,1544.14,2475.45,1695.58,
    1509.4,1892.53,1201.88,1454.49,2193.67,1544.14,2475.45,1695.58,
    1509.4,1892.53,1201.88,1454.49,2193.67,1544.14,2475.45,1695.58,
    1509.4,1892.53],
    06:[2191.43,2257.08,1110.43,1755.66,1374.96,1766.83,1915.29,1365.31,
    2191.43,2257.08,1110.43,1755.66,1374.96,1766.83,1915.29,1365.31,
    2191.43,2257.08,1110.43,1755.66,1374.96,1766.83,1915.29,1365.31,
    2191.43,2257.08],
    05:[2026.51,2135.07,1271.57,1357.04,1773.21,1869.4,1580.83,1271.68,
    2026.51,2135.07,1271.57,1357.04,1773.21,1869.4,1580.83,1271.68,
    2026.51,2135.07,1271.57,1357.04,1773.21,1869.4,1580.83,1271.68,
    2026.51,2135.07],
    04:[1853.58,1685.93,1301.73,1919.4,1248.27,2061.62,1329.68,1487.04,
    1853.58,1685.93,1301.73,1919.4,1248.27,2061.62,1329.68,1487.04,
    1853.58,1685.93,1301.73,1919.4,1248.27,2061.62,1329.68,1487.04,
    1853.58,1685.93],
    03:[1487.15,1337.31,1417.56,1463.38,1967.49,1898.89,1098.37,2084.7,
    1487.15,1337.31,1417.56,1463.38,1967.49,1898.89,1098.37,2084.7,
    1487.15,1337.31,1417.56,1463.38,1967.49,1898.89,1098.37,2084.7,
    1487.15,1337.31],
    02:[1249.99,1069.08,2311.69,1134.31,1754.78,1209.85,1343.49,1843.6,
    1249.99,1069.08,2311.69,1134.31,1754.78,1209.85,1343.49,1843.6,
    1249.99,1069.08,2311.69,1134.31,1754.78,1209.85,1343.49,1843.6,
    1249.99,1069.08]
});

dataMap.dataTI = dataFormatter({
    //max : 25000,
    11:[12363.18,5219.24,8483.17,3960.87,5015.89,8158.98,3679.91,4918.09,
    12363.18,5219.24,8483.17,3960.87,5015.89,8158.98,3679.91,4918.09,
    12363.18,5219.24,8483.17,3960.87,5015.89,8158.98,3679.91,4918.09,
    12363.18,5219.24],
    10:[10600.84,4238.65,7123.77,3412.38,4209.03,6849.37,3111.12,4040.55,
    10600.84,4238.65,7123.77,3412.38,4209.03,6849.37,3111.12,4040.55,
    10600.84,4238.65,7123.77,3412.38,4209.03,6849.37,3111.12,4040.55,
    10600.84,4238.65],
    09:[9179.19,3405.16,6068.31,2886.92,3696.65,5891.25,2756.26,3371.95,
    9179.19,3405.16,6068.31,2886.92,3696.65,5891.25,2756.26,3371.95,
    9179.19,3405.16,6068.31,2886.92,3696.65,5891.25,2756.26,3371.95,
    9179.19,3405.16],
    08:[8375.76,2886.65,5276.04,2759.46,3212.06,5207.72,3412.26,3905.68,
    8375.76,2886.65,5276.04,2759.46,3212.06,5207.72,3412.26,3905.68,
    8375.76,2886.65,5276.04,2759.46,3212.06,5207.72,3412.26,3905.68,
    8375.76,2886.65],
    07:[7236.15,2250.04,4600.72,2257.99,4467.41,4486.74,4225.44,3493.04,
    7236.15,2250.04,4600.72,2257.99,4467.41,4486.74,4225.44,3493.04,
    7236.15,2250.04,4600.72,2257.99,4467.41,4486.74,4225.44,3493.04,
    7236.15,2250.04],
    06:[5837.55,3902.31,3895.36,3846.18,3934.35,3798.26,3687.07,4096.35,
    5837.55,3902.31,3895.36,3846.18,3934.35,3798.26,3687.07,4096.35,
    5837.55,3902.31,3895.36,3846.18,3934.35,3798.26,3687.07,4096.35,
    5837.55,3902.31],
    05:[4854.33,3658.19,3340.54,3611.07,3542.26,3295.45,3413.83,3857.42,
    4854.33,3658.19,3340.54,3611.07,3542.26,3295.45,3413.83,3857.42,
    4854.33,3658.19,3340.54,3611.07,3542.26,3295.45,3413.83,3857.42,
    4854.33,3658.19],
    04:[4092.27,3319.76,2805.47,3375.67,4270,2811.95,4223.64,3657.77,
    4092.27,3319.76,2805.47,3375.67,4270,2811.95,4223.64,3657.77,
    4092.27,3319.76,2805.47,3375.67,4270,2811.95,4223.64,3657.77,
    4092.27,3319.76],
    03:[3435.95,3150.81,2439.68,3176.65,4000.79,2487.85,4075.48,3467.9,
    3435.95,3150.81,2439.68,3176.65,4000.79,2487.85,4075.48,3467.9,
    3435.95,3150.81,2439.68,3176.65,4000.79,2487.85,4075.48,3467.9,
    3435.95,3150.8],
    02:[2982.57,2997.47,4149.75,3992.69,3811.47,3258.17,3958.88,3319.4,
    2982.57,2997.47,4149.75,3992.69,3811.47,3258.17,3958.88,3319.4,
    2982.57,2997.47,4149.75,3992.69,3811.47,3258.17,3958.88,3319.4,
    2982.57,2997.47]
});

dataMap.dataEstate = dataFormatter({
    //max : 3600,
    11:[1074.93,1411.46,1918.02,1224.91,1384.76,1876.12,1238.61,1492.1,
    1074.93,1411.46,1918.02,1224.91,1384.76,1876.12,1238.61,1492.1,
    1074.93,1411.46,1918.02,1224.91,1384.76,1876.12,1238.61,1492.1,
    1074.93,1411.46],
    10:[1006.52,1377.59,1697.79,1952,1309.25,1733.37,2312.32,1391.89,
    1006.52,1377.59,1697.79,1952,1309.25,1733.37,2312.32,1391.89,
    1006.52,1377.59,1697.79,1952,1309.25,1733.37,2312.32,1391.89,
    1006.52,1377.59],
    09:[1062.47,1308.73,1322.4,1753.31,1286.65,1605.27,2030.14,1301.18,
    1062.47,1308.73,1322.4,1753.31,1286.65,1605.27,2030.14,1301.18,
    1062.47,1308.73,1322.4,1753.31,1286.65,1605.27,2030.14,1301.18,
    1062.47,1308.73],
    08:[1844.59,2027.88,1513.81,1366.04,1273.3,1500.81,1802.7,2044.47,
    1844.59,2027.88,1513.81,1366.04,1273.3,1500.81,1802.7,2044.47,
    1844.59,2027.88,1513.81,1366.04,1273.3,1500.81,1802.7,2044.47,
    1844.59,2027.88],
    07:[1821.5,1283.44,1467.97,1344.12,1941.01,1410.43,1453.03,1225.81,
    1821.5,1283.44,1467.97,1344.12,1941.01,1410.43,1453.03,1225.81,
    1821.5,1283.44,1467.97,1344.12,1941.01,1410.43,1453.03,1225.81,
    1821.5,1283.44],
    06:[1658.3,1556.64,1397.14,1157.01,1336.5,1318.54,1331.01,1914.7,
    1658.3,1556.64,1397.14,1157.01,1336.5,1318.54,1331.01,1914.7,
    1658.3,1556.64,1397.14,1157.01,1336.5,1318.54,1331.01,1914.7,
    1658.3,1556.64],
    05:[1493.73,1222.67,1330.87,1506,1298.75,2506.77,1312.29,1630.34,
    1493.73,1222.67,1330.87,1506,1298.75,2506.77,1312.29,1630.34,
    1493.73,1222.67,1330.87,1506,1298.75,2506.77,1312.29,1630.34,
    1493.73,1222.67],
    04:[1436.11,1306.14,2031.08,1295.1,1173.81,2003.1,1297.93,1307.74,
    1436.11,1306.14,2031.08,1295.1,1173.81,2003.1,1297.93,1307.74,
    1436.11,1306.14,2031.08,1295.1,1173.81,2003.1,1297.93,1307.74,
    1436.11,1306.14],
    03:[1341.88,1292.31,1185.19,1178.73,1261.05,1088.49,1191.99,1207.2,
    1341.88,1292.31,1185.19,1178.73,1261.05,1088.49,1191.99,1207.2,
    1341.88,1292.31,1185.19,1178.73,1261.05,1088.49,1191.99,1207.2,
    1341.88,1292.31],
    02:[2098.02,1273.04,1140.89,1265.83,1151.48,1130.94,1076.11,1018.7,
    2098.02,1273.04,1140.89,1265.83,1151.48,1130.94,1076.11,1018.7,
    2098.02,1273.04,1140.89,1265.83,1151.48,1130.94,1076.11,1018.7,
    2098.02,1273.04]
});

dataMap.dataFinancial = dataFormatter({
    //max : 3200,
    11:[2215.41,1756.5,1746.01,1519.32,1447.46,1755.57,2107.65,1170.78,
    2215.41,1756.5,1746.01,1519.32,1447.46,1755.57,2107.65,1170.78,
    2215.41,1756.5,1746.01,1519.32,1447.46,1755.57,2107.65,1170.78,
    2215.41,1756.5],
    10:[1863.61,1572.99,1615.42,1448.3,1346.44,1639.27,1290.12,1304.59,
    1863.61,1572.99,1615.42,1448.3,1346.44,1639.27,1290.12,1304.59,
    1863.61,1572.99,1615.42,1448.3,1346.44,1639.27,1290.12,1304.59,
    1863.61,1572.99],
    09:[1603.63,1461.2,1525.67,161.64,1291.1,1560.2,1280.83,2127.54,
    1603.63,1461.2,1525.67,161.64,1291.1,1560.2,1280.83,2127.54,
    1603.63,1461.2,1525.67,161.64,1291.1,1560.2,1280.83,2127.54,
    1603.63,1461.2],
    08:[1519.19,1368.1,1420.74,2390.91,2219.09,1455.07,1547.24,2019.09,
    1519.19,1368.1,1420.74,2390.91,2219.09,1455.07,1547.24,2019.09,
    1519.19,1368.1,1420.74,2390.91,2219.09,1455.07,1547.24,2019.09,
    1519.19,1368.1],
    07:[1302.77,2288.17,1347.65,2118.73,1548.3,1386.34,1246.03,1219.09,
    1302.77,2288.17,1347.65,2118.73,1548.3,1386.34,1246.03,1219.09,
    1302.77,2288.17,1347.65,2118.73,1548.3,1386.34,1246.03,1219.09,
    1302.77,2288.17],
    06:[1982.37,1686.87,2184.04,1269.63,1408.21,1303.41,1300.75,1274.17,
    1982.37,1686.87,2184.04,1269.63,1408.21,1303.41,1300.75,1274.17,
    1982.37,1686.87,2184.04,1269.63,1408.21,1303.41,1300.75,1274.17,
    1982.37,1686.87],
    05:[1840.2,1457.4,2130.47,1235.07,2172.52,2032.85,1683.63,1835.03,
    1840.2,1457.4,2130.47,1235.07,2172.52,2032.85,1683.63,1835.03,
    1840.2,1457.4,2130.47,1235.07,2172.52,2032.85,1683.63,1835.03,
    1840.2,1457.4],
    04:[1713.79,2136.97,2109.1,2110.29,2155.89,1488.04,2277.17,3132.2,
    1713.79,2136.97,2109.1,2110.29,2155.89,1488.04,2277.17,3132.2,
    1713.79,2136.97,2109.1,2110.29,2155.89,1488.04,2277.17,3132.2,
    1713.79,2136.97],
    03:[1635.56,1112.79,1990.87,1180.48,1355.89,1455.38,1373.15,1432.2,
    1635.56,1112.79,1990.87,1180.48,1355.89,1455.38,1373.15,1432.2,
    1635.56,1112.79,1990.87,1180.48,1355.89,1455.38,1373.15,1432.2,
    1635.56,1112.79],
    02:[1561.91,1076.86,1079.6,1024.1,1048.39,1037.18,1075.45,1031.6,
    1561.91,1076.86,1079.6,1024.1,1048.39,1037.18,1075.45,1031.6,
    1561.91,1076.86,1079.6,1024.1,1048.39,1037.18,1075.45,1031.6,
    1561.91,1076.86]
});


option = {
    
    baseOption: {
        timeline: {
            // y: 0,
            axisType: 'category',
            // realtime: false,
            // loop: false,
            autoPlay: true,
            // currentIndex: 2,
            playInterval: 1000,
            // controlStyle: {
            //     position: 'left'
            // },
            data: [
                '02','03','04',
                {
                    value: '05',
                    tooltip: {
                        formatter: '{b} GDP达到一个高度'
                    },
                    symbol: 'diamond',
                    symbolSize: 16
                },
                '06', '07','08','09','10',
                {
                    value: '11',
                    tooltip: {
                        formatter: function (params) {
                            return params.name + 'GDP达到又一个高度';
                        }
                    },
                    symbol: 'diamond',
                    symbolSize: 18
                },
            ],
            label: {
                formatter : function(s) {
                    return s+"日";
                }
            }
        },
        title: {
            subtext: '数据来自下属电厂物资系统'
        },
        tooltip: {},
        legend: {
            x: 'right',
            data: ['来煤', '耗煤', '存煤', '来煤总量', '耗煤总量', '存煤总量'],
            selected: {
                '来煤总量': false, '耗煤总量': false, '存煤总量': false
            }
        },
        calculable : true,
        grid: {
            top: 80,
            bottom: 100
        },
        dataZoom : {
        show : false,
        realtime : true,
        start : 0,
        end : 30
    },
        xAxis: [
            {
                'type':'category',
                'axisLabel':{'interval':0,rotate: 60,
                textStyle : {
   fontWeight : 'bold',
color : '#ffffff'
}},
                'data':[
                    '秦皇岛电厂','大港电厂','白马电厂','阜康电厂','鄂温克电厂','和丰电厂','河曲电厂','花园电厂'
    ,'焦作电厂','神二电厂','灵州电厂','大南湖电厂','重庆电厂','鸳鸯湖电厂','王曲电厂','府谷电厂',
    '萨拉齐电厂','保德神东发电公司','亿利电厂','店塔电厂','郭家湾电厂','米东电厂',
    '神木电厂','万州电厂','五彩湾电厂','上湾电厂'
                ],
                splitLine: {show: false}
            }
        ],
        yAxis: [
            {
                type: 'value',
                axisLabel : {
show : true,
textStyle : {
   fontWeight : 'bold',
color : '#ffffff'
}
},
                name: '煤量(吨)'
                
            }
        ],
        series: [
            {name: '来煤总量', type: 'bar'},
            {name: '耗煤总量', type: 'bar'},
            {name: '存煤总量', type: 'bar'},
            {name: '来煤', type: 'bar'},
            {name: '耗煤', type: 'bar'},
            {name: '存煤', type: 'bar'},
            
            {
                name: '来耗存总量',
                type: 'pie',
                center: ['80%', '20%'],
                radius: '25%'
            }
        ],
         emphasis: {
                   shadowBlur: 10,
                   shadowOffsetX: 0,
                   shadowColor: 'rgba(0, 0, 0, 0.5)'
               },
  color: ['#9965e4','#003bc2','#310376']
    },
    options: [
        {
            title: {text: '02日煤量统计'},
            series: [
                
                {data: dataMap.dataGDP['2']},
                {data: dataMap.dataFinancial['2']},
                {data: dataMap.dataEstate['2']},
                {data: dataMap.dataPI['2']},
                {data: dataMap.dataSI['2']},
                {data: dataMap.dataTI['2']},
                
                {data: [
                    {name: '来煤', value: dataMap.dataPI['2sum']},
                    {name: '耗煤', value: dataMap.dataSI['2sum']},
                    {name: '存煤', value: dataMap.dataTI['2sum']}
                ]}
            ]
        },
        {
            title : {text: '03日煤量统计'},
            series : [
                {data: dataMap.dataGDP['3']},
                {data: dataMap.dataFinancial['3']},
                {data: dataMap.dataEstate['3']},
                {data: dataMap.dataPI['3']},
                {data: dataMap.dataSI['3']},
                {data: dataMap.dataTI['3']},
                {data: [
                    {name: '来煤', value: dataMap.dataPI['3sum']},
                    {name: '耗煤', value: dataMap.dataSI['3sum']},
                    {name: '存煤', value: dataMap.dataTI['3sum']}
                ]}
            ]
        },
        {
            title : {text: '04日煤量统计'},
            series : [
                {data: dataMap.dataGDP['4']},
                {data: dataMap.dataFinancial['4']},
                {data: dataMap.dataEstate['4']},
                {data: dataMap.dataPI['4']},
                {data: dataMap.dataSI['4']},
                {data: dataMap.dataTI['4']},
                {data: [
                    {name: '来煤', value: dataMap.dataPI['4sum']},
                    {name: '耗煤', value: dataMap.dataSI['4sum']},
                    {name: '存煤', value: dataMap.dataTI['4sum']}
                ]}
            ]
        },
        {
            title : {text: '05日煤量统计'},
            series : [
                {data: dataMap.dataGDP['5']},
                {data: dataMap.dataFinancial['5']},
                {data: dataMap.dataEstate['5']},
                {data: dataMap.dataPI['5']},
                {data: dataMap.dataSI['5']},
                {data: dataMap.dataTI['5']},
                {data: [
                    {name: '来煤', value: dataMap.dataPI['5sum']},
                    {name: '耗煤', value: dataMap.dataSI['5sum']},
                    {name: '存煤', value: dataMap.dataTI['5sum']}
                ]}
            ]
        },
        {
            title : {text: '06日煤量统计'},
            series : [
                {data: dataMap.dataGDP['6']},
                {data: dataMap.dataFinancial['6']},
                {data: dataMap.dataEstate['6']},
                {data: dataMap.dataPI['6']},
                {data: dataMap.dataSI['6']},
                {data: dataMap.dataTI['6']},
                {data: [
                    {name: '来煤', value: dataMap.dataPI['6sum']},
                    {name: '耗煤', value: dataMap.dataSI['6sum']},
                    {name: '存煤', value: dataMap.dataTI['6sum']}
                ]}
            ]
        },
        {
            title : {text: '07日煤量统计'},
            series : [
                {data: dataMap.dataGDP['7']},
                {data: dataMap.dataFinancial['7']},
                {data: dataMap.dataEstate['7']},
                {data: dataMap.dataPI['7']},
                {data: dataMap.dataSI['7']},
                {data: dataMap.dataTI['7']},
                {data: [
                    {name: '来煤', value: dataMap.dataPI['7sum']},
                    {name: '耗煤', value: dataMap.dataSI['7sum']},
                    {name: '存煤', value: dataMap.dataTI['7sum']}
                ]}
            ]
        },
        {
            title : {text: '08日煤量统计'},
            series : [
                {data: dataMap.dataGDP['8']},
                {data: dataMap.dataFinancial['8']},
                {data: dataMap.dataEstate['8']},
                {data: dataMap.dataPI['8']},
                {data: dataMap.dataSI['8']},
                {data: dataMap.dataTI['8']},
                {data: [
                    {name: '来煤', value: dataMap.dataPI['8sum']},
                    {name: '耗煤', value: dataMap.dataSI['8sum']},
                    {name: '存煤', value: dataMap.dataTI['8sum']}
                ]}
            ]
        },
        {
            title : {text: '09日煤量统计'},
            series : [
                {data: dataMap.dataGDP['9']},
                {data: dataMap.dataFinancial['9']},
                {data: dataMap.dataEstate['9']},
                {data: dataMap.dataPI['9']},
                {data: dataMap.dataSI['9']},
                {data: dataMap.dataTI['9']},
                {data: [
                    {name: '来煤', value: dataMap.dataPI['9sum']},
                    {name: '耗煤', value: dataMap.dataSI['9sum']},
                    {name: '存煤', value: dataMap.dataTI['9sum']}
                ]}
            ]
        },
        {
            title : {text: '10日煤量统计'},
            series : [
                {data: dataMap.dataGDP['10']},
                {data: dataMap.dataFinancial['10']},
                {data: dataMap.dataEstate['10']},
                {data: dataMap.dataPI['10']},
                {data: dataMap.dataSI['10']},
                {data: dataMap.dataTI['10']},
                {data: [
                    {name: '来煤', value: dataMap.dataPI['10sum']},
                    {name: '耗煤', value: dataMap.dataSI['10sum']},
                    {name: '存煤', value: dataMap.dataTI['10sum']}
                ]}
            ]
        },
        {
            title : {text: '11日煤量统计'},
            series : [
                {data: dataMap.dataGDP['11']},
                {data: dataMap.dataFinancial['11']},
                {data: dataMap.dataEstate['11']},
                {data: dataMap.dataPI['11']},
                {data: dataMap.dataSI['11']},
                {data: dataMap.dataTI['11']},
                {data: [
                    {name: '来煤', value: dataMap.dataPI['11sum']},
                    {name: '耗煤', value: dataMap.dataSI['11sum']},
                    {name: '存煤', value: dataMap.dataTI['11sum']}
                ]}
            ]
        }
    ]
   };

加载中
0
一口没水的枯井
一口没水的枯井

我没之前版本的代码了,我当时用的是林峰给的 

option.dataZoom.start += 5;option.dataZoom.end += 5;option.animation = false;myChart.setOption(option);

0
落灬梦
落灬梦
很感谢您给我的回帖,我也用了下林峰这个代码,但是不能自己移动,刷新完动一下,然后没变化了,您当时插入哪个位置?效果和我的一样吗?
返回顶部
顶部