国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - Bagaimana untuk menghantar parameter kepada dua carta yang dibuat oleh echarts dari Android? ?
伊謝爾倫
伊謝爾倫 2017-05-16 13:25:55
0
2
824

Bagaimana untuk memindahkan parameter ke dua carta yang dibuat oleh echarts daripada Android? ?
Kodnya adalah seperti berikut:
<script type="text/javascript">

function setEchart(data,nums){
    var myChart = echarts.init(document.getElementById('zh-chart'));
    var option = {
        title:{
            text:'每小時(shí)的起飛航班總數(shù)和每小時(shí)的航班延誤數(shù)對比分析',
            padding:[10,10],
            x: 'center',
            align: 'right',
            textStyle: {
                color: '#fff',
                fontSize: 14,
            }
        },
        tooltip : {
            trigger: 'axis',
            axisPointer : {
                type : 'shadow'
            },
            textStyle: {
                color: "#2088C2",
                fontSize: 12
            },
        },
        legend: {
            data:['每小時(shí)的起飛航班總數(shù)','每小時(shí)的航班延誤數(shù)'],
            textStyle: {
                color: '#fff',
                fontSize: 14,
            },
            padding:[35,15]
        },
        xAxis : [
            {
                type : 'category',
                // data : ['050416','050417','050418','050419','050420','050421','050422','050423','050500','050501','050502','050503','050504','050505','050506','050507','050508','050509','050510','050511','050512','050513','050514','050515'],
                data:data,
                nameTextStyle: {
                    color: '#fff',
                    fontSize: 14,
                },
                axisLine: {
                    lineStyle: {
                        color: '#ccc'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: "#9ea4ba",
                        fontSize: 13
                    }
                }
            }
        ],
        yAxis : [
            {
                type : 'value',
                nameTextStyle: {
                    color: '#fff',
                    fontSize: 14
                },

                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#ccc'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: "#9ea4ba",
                        fontSize: 13
                    },
                }
            }
        ],
        series : [
            {
                name:'每小時(shí)的起飛航班總數(shù)',
                type:'bar',
                itemStyle: {
                    normal: {
                        barBorderRadius: 5,
                        color: new echarts.graphic.LinearGradient(
                            0, 0, 0, 1,
                            [
                                {offset: 0, color: '#14c8d4'},
                                {offset: 1, color: '#43eec6'}
                            ]
                        )
                    }
                },
                // data:[1, 0, 0, 0, 0, 3,12, 21, 14, 10, 17, 14, 14,16, 15, 14, 13, 15, 15,10,12,10, 15, 5]
                data:nums,
            },
            {
                name:'每小時(shí)的航班延誤數(shù)',
                type:'bar',
                itemStyle: {
                    normal: {
                        barBorderRadius: 5,
                        color: new echarts.graphic.LinearGradient(
                            0, 0, 0, 1,
                            [
                                {offset: 0, color: '#ce0320'},
                                {offset: 1, color: '#f71334'}
                            ]
                        )
                    }
                },
                data:nums,
            }
        ]
    };
    myChart.setOption(option);
    window.onresize=function(){
        myChart.resize()
    }
}
setEchart();
function setchart2(dataRate,numRate){
    var myChart2 = echarts.init(document.getElementById('zh-cahrt2'));
    var option2 = {
        title:{
            text:'全天總正常率和每小時(shí)正常率統(tǒng)計(jì)對比分析',
            padding:[10,10],
            x: 'center',
            align: 'right',
            textStyle: {
                color: '#fff',
                fontSize: 14,
            }
        },
        tooltip : {
            trigger: 'axis',
            axisPointer : { 
                type : 'shadow'
            },
            textStyle: {
                color: "#2088C2",
                fontSize: 12
            },
        },
        legend: {
            data:['24小時(shí)的總正常率統(tǒng)計(jì)','每小時(shí)的正常率統(tǒng)計(jì)'],
            textStyle: {
                color: '#fff',
                fontSize: 14,
            },
            padding:[35,15]
        },
        xAxis : [
            {
                type : 'category',
                // data : ['050416','050417','050418','050419','050420','050421','050422','050423','050500','050501','050502','050503','050504','050505','050506','050507','050508','050509','050510','050511','050512','050513','050514','050515'],
                data:dataRate,
                nameTextStyle: {
                    color: '#fff',
                    fontSize: 16,
                },
                axisLine: {
                    lineStyle: {
                        color: '#ccc'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: "#9ea4ba",
                        fontSize: 13
                    }
                }
            }
        ],
        yAxis : [
            {
                type : 'value',
                nameTextStyle: {
                    color: '#fff',
                    fontSize: 16
                },

                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#ccc'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: "#9ea4ba",
                        fontSize: 13
                    },
                }
            }
        ],
        series : [
            {
                name:'24小時(shí)的總正常率統(tǒng)計(jì)',
                type:'line',
                itemStyle: {
                    normal: {
                        barBorderRadius: 5,
                        color: new echarts.graphic.LinearGradient(
                            0, 0, 0, 1,
                            [
                                {offset: 0, color: '#14c8d4'},
                                {offset: 1, color: '#43eec6'}
                            ]
                        )
                    }
                },
                // data:[0, 0, 0, 0, 0,25, 81.25,83.78, 86.27,88.52, 91.03,91.3, 91.51,91.8, 91.97, 92.05,92.68, 92.74, 91.24,91.18,90.28,90.71, 90.04, 89.02]
                data:numRate,
            },
            {
                name:'每小時(shí)的正常率統(tǒng)計(jì)',
                type:'line',
                itemStyle: {
                    normal: {
                        barBorderRadius: 5,
                        color: new echarts.graphic.LinearGradient(
                            0, 0, 0, 1,
                            [
                                {offset: 0, color: '#ce0320'},
                                {offset: 1, color: '#f71334'}
                            ]
                        )
                    }
                },
                // data:[0, 100, 100, 100, 100, 33.33,100, 85.71, 100, 100, 100, 92.86, 92.86,93.75, 93.33, 92.86, 100, 93.33, 73.33,90,75,100, 80, 40]
                data:numRate
            }
        ]
    };
    myChart2.setOption(option2);
    window.onresize=function(){
        myChart2.resize()
    }
}
setchart2();

& lt;/skrip & gt; setiap carta),,, saya tidak tahu sama ada ini betul? ? ? ? Bolehkah pakar memberi saya beberapa idea? ?

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無限,來學(xué)PHP伐。

membalas semua(2)
PHPzhong

Parameter yang diluluskan oleh Android ialah rentetan, jadi anda boleh terus melepasi rentetan JSON dan menghuraikannya dengan JSON.Stringify di bahagian web.

phpcn_u1582

Saya rasa anda adalah pembangun Hibrid dan anda bertanggungjawab untuk halaman H5. Bahagian Asli telah memperoleh data dari latar belakang dan perlu memajukan data kepada anda dan kemudian melukis carta. Apa yang anda tidak faham sekarang ialah cara Android menghantar data kepada anda dan apakah format data itu.
Anda boleh lihat jawapan saya /q/10..., mula-mula jelaskan penghantaran data antara Native dan H5, dan kembali kepada soalan anda, Native memanggil kaedah yang anda tulis dalam antara muka H5 melalui kod yang serupa dengan yang berikut , webview.loadUrl(javascript:yourFunc(data););, data yang diluluskan ialah rentetan, anda boleh menetapkan sendiri format, biasanya rentetan JSON, anda perlu menukar rentetan ini kepada JSON, dan kemudian dapatkannya melalui kunci

Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan