Spider HighChart的问题,因为它有时会显示为折线图

时间:2016-05-06 10:03:01

标签: javascript highcharts

我在Spider HighChart遇到一些问题,因为它在一个位置显示为折线图,而在另一个位置显示为蜘蛛图表。

我使用的是高图表库中非常简单的代码。它是与图表类型为线条和图表极坐标为真的部分相关的东西。

请建议可能出现的错误?

$('#container').highcharts({
    credits:{enabled:false},
    chart: {
        polar: 'true',
        type: 'line',
        width: 850,
        height: 700
    },

    title: {
        text: 'Alliance Performance',
        x: 0
    },

    pane: {
        size: '80%'
    },

    xAxis: {
        categories: ['alliance with Company', 'The right people from both sides of the alliance', 'Decisions related to our alliance', 'Rationale for decisions demonstrates strong consideration of our business and our needs', 'Lessons learned are incorporated into work processes or practices', 'Expectations and deadlines', 'Critical information', 'When decisions are made, both parties have a clear understanding and alignment on the rationale'],
   labels: {
        style: {
            fontSize: '11px',
            fontFamily: 'Verdana, sans-serif',
            width: 300

        }
    },            

    },

    yAxis: {
        gridLineInterpolation: 'polygon',
        lineWidth: 0,
        min: 0
    },

    tooltip: {
        shared: true,
        pointFormat: '<span style="color:{series.color}">{series.name}: <b>{point.y:,.0f}</b><br/>'
    },

    legend: {
        align: 'Top',
        verticalAlign: 'Top',
        y: 30,
        enabled: true,
        layout: 'vertical'
    },

    series: [{
        name: 'Employees',
        data: [3.1, 3.0, 3.1, 5.0, 1.5, 2.0, 3.6, 4.5],
        pointPlacement: 'on'
    },{
        name: 'Partners',
        data: [2.1, 4.0, 3.1, 4.0, 3.5, 2.0, 5.0, 4.6],
        pointPlacement: 'on'
    }]

});

2 个答案:

答案 0 :(得分:0)

在有折线图的位置,您将错过对highcharts-more.js文件的引用。请确保在两个位置都附加了所有必需的文件。

答案 1 :(得分:0)

您的字符显示为折线图,因为缺少“ highcharts-more.js ”。

添加此脚本后,图表将按预期显示为蜘蛛网。

例如:

包括更多图表 Including highcharts-more

缺少更多图表 Missing highcharts-more