简体   繁体   English

未捕获的TypeError:无法读取未定义的属性'0'-highcharts

[英]Uncaught TypeError: Cannot read property '0' of undefined - highcharts

i am trying to draw HighCharts - Polar wind Rose Chart 我正在尝试绘制HighCharts-极风玫瑰图

ref : http://www.highcharts.com/demo/polar-wind-rose 参考: http : //www.highcharts.com/demo/polar-wind-rose

but the charts doesnt get draw when i check console of my chrome i found this error Uncaught TypeError: Cannot read property '0' of undefined 但是当我检查我的Chrome控制台时,图表没有绘制,我发现了此错误Uncaught TypeError:无法读取未定义的属性“ 0”

Couldnt able to get why this is coming 无法知道为什么会这样

My JS Code : 我的JS代码:

function createWindRoseChart(divID, tableID, graphTitle) {
    var chart = new Highcharts.Chart({
        data: {
            table: tableID,
            startRow: 1,
            endRow: 10,
            endColumn: 8
        },
        chart: {
            polar: true,
            type: 'column',
            renderTo: divID,
            backgroundColor: 'rgba(255, 255, 255, 0.1)'
        },

        title: {
            text: graphTitle
        },

        subtitle: {

        },

        pane: {
            size: '85%'
        },

        legend: {
            reversed: true,
            align: 'right',
            verticalAlign: 'top',
            y: 100,
            layout: 'vertical'
        },

        xAxis: {
            tickmarkPlacement: 'on'
        },

        yAxis: {
            min: 0,
            endOnTick: false,
            showLastLabel: true,
            title: {
                text: 'Frequency (%)'
            },
            labels: {
                formatter: function () {
                    return this.value + '%';
                }
            }
        },

        tooltip: {
            valueSuffix: '%',
            followPointer: true
        },

        plotOptions: {
            series: {
                stacking: 'normal',
                shadow: false,
                groupPadding: 0,
                pointPlacement: 'on'
            }
        }
    });
}

Its Calling function 它的通话功能

createWindRoseChart('divCRATicketType', 'freq', 'Calls Open');

HTML Table for Creating Wind Rose Chart 用于创建风玫瑰图的HTML表

<html>
    <body>
        <table id='freq' border='1' cellpadding='5' align='center'>
            <tr align='center'><th class='freq'>CRA</th><th class='freq'>FLM</th><th class='freq'>SLM</th><th class='freq'>Network</th><th class='freq'>UPS</th><th class='freq'>Electrical</th><th class='freq'>Power Failure</th><th class='freq'>Bank</th><th class='freq'>Cashout</th></tr>
            <tr align='center'><td class='dir'>SIS</td><td class='data'>2</td><td class='data'>1</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td><td class='data'>1</td><td class='data'>0</td><td class='data'>0</td></tr>
            <tr align='center'><td class='dir'>S&IB</td><td class='data'>2</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td></tr>
            <tr align='center'><td class='dir'>Branch</td><td class='data'>1</td><td class='data'>1</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td><td class='data'>0</td></tr>
            <tr align='center'><td class='dir'>Securitrans</td><td class='data'>45</td><td class='data'>13</td><td class='data'>4</td><td class='data'>1</td><td class='data'>6</td><td class='data'>4</td><td class='data'>1</td><td class='data'>0</td></tr>
            <tr align='center'><td class='dir'>Writer</td><td class='data'>33</td><td class='data'>8</td><td class='data'>5</td><td class='data'>0</td><td class='data'>4</td><td class='data'>0</td><td class='data'>4</td><td class='data'>1</td></tr>
            <tr align='center'><td class='dir'>CMS</td><td class='data'>86</td><td class='data'>23</td><td class='data'>6</td><td class='data'>12</td><td class='data'>5</td><td class='data'>13</td><td class='data'>4</td><td class='data'>7</td></tr>
            <tr align='center'><td class='dir'>SDB CISCO</td><td class='data'>20</td><td class='data'>5</td><td class='data'>1</td><td class='data'>0</td><td class='data'>3</td><td class='data'>6</td><td class='data'>3</td><td class='data'>1</td></tr>
            <tr align='center'><td class='dir'>Brinks</td><td class='data'>27</td><td class='data'>5</td><td class='data'>2</td><td class='data'>2</td><td class='data'>0</td><td class='data'>0</td><td class='data'>7</td><td class='data'>1</td></tr>
            <tr align='center'><td class='dir'>Secure Value</td><td class='data'>30</td><td class='data'>8</td><td class='data'>1</td><td class='data'>1</td><td class='data'>2</td><td class='data'>3</td><td class='data'>7</td><td class='data'>0</td></tr>
        </table>
    </body>
</html>

Here's a proper polar chart with your data: 这是一个包含您数据的正确polar图:

在此处输入图片说明

Fiddle example here . 这里的小提琴例子。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Highcharts / Highmaps未捕获的TypeError:无法读取未定义错误的属性“ 0” - Highcharts/Highmaps Uncaught TypeError: Cannot read property '0' of undefined error 未捕获的TypeError:无法读取未定义的javascript错误并带有highcharts的属性“ 0” - Uncaught TypeError: Cannot read property '0' of undefined javascript error and with highcharts 未捕获的TypeError:无法读取Highcharts的undefined属性“ map” - Uncaught TypeError: Cannot read property 'map' of undefined with Highcharts highcharts heatmap未捕获的TypeError:无法读取未定义的属性“ prototype” - highcharts heatmap Uncaught TypeError: Cannot read property 'prototype' of undefined 未捕获的TypeError:无法读取未定义的属性“未定义” - Uncaught TypeError: Cannot read property 'undefined' of undefined highcharts:TypeError:无法读取未定义的属性“ 0” - highcharts: TypeError: Cannot read property '0' of undefined 未捕获的TypeError:无法读取未定义的属性“数量” - Uncaught TypeError: Cannot read property 'quantity' of undefined 未捕获的TypeError:无法读取未定义的属性&#39;fromJSON&#39; - Uncaught TypeError: Cannot read property 'fromJSON' of undefined 未捕获的TypeError:无法读取未定义的属性“ timing” - Uncaught TypeError: Cannot read property 'timing' of undefined 未捕获的TypeError:无法读取未定义的属性&#39;formatter&#39; - Uncaught TypeError: Cannot read property 'formatter' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM