如何旋转极坐标图?

时间:2013-03-04 18:29:30

标签: highcharts

我想要一张极坐标图(带有高图库),但我需要将图表旋转45º。我有以下基本脚本:

$(function () {

var interval = 90;
var startAngle = 0;

window.chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        polar: true,
        margin: 60
    },
    title: {
        text: 'Style of thought',
    },
    pane: {
        startAngle: startAngle
    },
    xAxis: {
        tickmarkPlacement: 'on',
        startOnTick: true,
        tickInterval: interval,
        min: 0,
        max: 360
    },
    yAxis: {
        min: 0,
        max: 100
    },
    plotOptions: {
        series: {
            pointStart: 0,
            pointInterval: interval
        },
        column: {
            pointPadding: 0,
            groupPadding: 0
        }
    },
    series: [
        {
            type: 'area',
            name: 'Luis',
            data: [40, 60, 35, 89]
        }, {
            type: 'line',
            name: 'Media de comunidad',
            data: [60, 75, 15, 52]
        }]
    });
});

Example in jsfiddle和图表很好。

我需要将图表旋转45º,为此我将startAngle的值更改为45

$(function () {

var interval = 90;
var startAngle = 45;

window.chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        polar: true,
        margin: 60
    },
    title: {
        text: 'Style of thought',
    },
    pane: {
        startAngle: startAngle
    },
    xAxis: {
        tickmarkPlacement: 'on',
        startOnTick: true,
        tickInterval: interval,
        min: 0,
        max: 360
    },
    yAxis: {
        min: 0,
        max: 100
    },
    plotOptions: {
        series: {
            pointStart: 0,
            pointInterval: interval
        },
        column: {
            pointPadding: 0,
            groupPadding: 0
        }
    },
    series: [
        {
            type: 'area',
            name: 'Luis',
            data: [40, 60, 35, 89]
        }, {
            type: 'line',
            name: 'Media de comunidad',
            data: [60, 75, 15, 52]
        }]
});
});

Example 2 in jsfiddle现在图表很糟糕。如果你看到它,圆的中心与圆周不等。

对这个问题有什么想法吗?

非常感谢!!

1 个答案:

答案 0 :(得分:0)

它看起来像一个错误,所以我在这里向我们的开发人员报告:https://github.com/highslide-software/highcharts.com/issues/1561

感谢您的建议