Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java GWT海图-半圆甜甜圈_Java_Javascript_Gwt_Highcharts - Fatal编程技术网

Java GWT海图-半圆甜甜圈

Java GWT海图-半圆甜甜圈,java,javascript,gwt,highcharts,Java,Javascript,Gwt,Highcharts,我正在使用GWT Highcharts并希望创建半圆甜甜圈。这是在javascript中通过plotOptions.pie.startAngle和plotOptions.pie.endAngle完成的。在GWT高图中似乎没有这样的方法。然后我尝试用.setOption/plotOptions/pie/endAngle,90手动设置,但没有效果。也许GWT Highcharts支持的HighStock 1.2.4最新版本不支持这一点 我的代码如下所示: final Chart chart = ne

我正在使用GWT Highcharts并希望创建半圆甜甜圈。这是在javascript中通过plotOptions.pie.startAngle和plotOptions.pie.endAngle完成的。在GWT高图中似乎没有这样的方法。然后我尝试用.setOption/plotOptions/pie/endAngle,90手动设置,但没有效果。也许GWT Highcharts支持的HighStock 1.2.4最新版本不支持这一点

我的代码如下所示:

final Chart chart = new Chart()
.setType(Series.Type.PIE)
.setChartTitleText("Browser market shares at a specific website, 2010")
.setPlotBackgroundColor((String) null)
.setPlotBorderWidth(null)

.setPlotShadow(false)
.setOption("/plotOptions/pie/startAngle", "-90")
.setOption("/plotOptions/pie/endAngle", "90")
.setPiePlotOptions(new PiePlotOptions()

    .setAllowPointSelect(true)
    .setCursor(PlotOptions.Cursor.POINTER)
    .setPieDataLabels(new PieDataLabels()
        .setConnectorColor("#000000")
        .setEnabled(true)
        .setColor("#000000")
        .setFormatter(new DataLabelsFormatter() {
            @Override
            public String format(DataLabelsData dataLabelsData) {
                return "<b>" + dataLabelsData.getPointName() + "</b>: " + dataLabelsData.getYAsDouble() + " %";
            }
        })
    )
)
.setLegend(new Legend()
    .setLayout(Legend.Layout.VERTICAL)
    .setAlign(Legend.Align.RIGHT)
    .setVerticalAlign(Legend.VerticalAlign.TOP)
    .setX(-100)
    .setY(100)
    .setFloating(true)
    .setBorderWidth(1)
    .setBackgroundColor("#FFFFFF")
    .setShadow(true)
)
.setToolTip(new ToolTip()
    .setFormatter(new ToolTipFormatter() {
        @Override
        public String format(ToolTipData toolTipData) {
            return "<b>" + toolTipData.getPointName() + "</b>: " + toolTipData.getYAsDouble() + " %";
        }
    })
);
$(function () {
    $('#container').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: 0,
            plotShadow: false
        },
        title: {
            text: 'Browser<br>shares',
            align: 'center',
            verticalAlign: 'middle',
            y: 50
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                dataLabels: {
                    enabled: true,
                    distance: -50,
                    style: {
                        fontWeight: 'bold',
                        color: 'white',
                        textShadow: '0px 1px 2px black'
                    }
                },
                startAngle: -90,
                endAngle: 90,
                center: ['50%', '75%']
            }
        },
        series: [{
            type: 'pie',
            name: 'Browser share',
            innerSize: '50%',
            data: [
                ['Firefox',   45.0],
                ['IE',       26.8],
                ['Chrome', 12.8],
                ['Safari',    8.5],
                ['Opera',     6.2],
                {
                    name: 'Others',
                    y: 0.7,
                    dataLabels: {
                        enabled: false
                    }
                }
            ]
        }]
    });
});
工作脚本如下所示:

final Chart chart = new Chart()
.setType(Series.Type.PIE)
.setChartTitleText("Browser market shares at a specific website, 2010")
.setPlotBackgroundColor((String) null)
.setPlotBorderWidth(null)

.setPlotShadow(false)
.setOption("/plotOptions/pie/startAngle", "-90")
.setOption("/plotOptions/pie/endAngle", "90")
.setPiePlotOptions(new PiePlotOptions()

    .setAllowPointSelect(true)
    .setCursor(PlotOptions.Cursor.POINTER)
    .setPieDataLabels(new PieDataLabels()
        .setConnectorColor("#000000")
        .setEnabled(true)
        .setColor("#000000")
        .setFormatter(new DataLabelsFormatter() {
            @Override
            public String format(DataLabelsData dataLabelsData) {
                return "<b>" + dataLabelsData.getPointName() + "</b>: " + dataLabelsData.getYAsDouble() + " %";
            }
        })
    )
)
.setLegend(new Legend()
    .setLayout(Legend.Layout.VERTICAL)
    .setAlign(Legend.Align.RIGHT)
    .setVerticalAlign(Legend.VerticalAlign.TOP)
    .setX(-100)
    .setY(100)
    .setFloating(true)
    .setBorderWidth(1)
    .setBackgroundColor("#FFFFFF")
    .setShadow(true)
)
.setToolTip(new ToolTip()
    .setFormatter(new ToolTipFormatter() {
        @Override
        public String format(ToolTipData toolTipData) {
            return "<b>" + toolTipData.getPointName() + "</b>: " + toolTipData.getYAsDouble() + " %";
        }
    })
);
$(function () {
    $('#container').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: 0,
            plotShadow: false
        },
        title: {
            text: 'Browser<br>shares',
            align: 'center',
            verticalAlign: 'middle',
            y: 50
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                dataLabels: {
                    enabled: true,
                    distance: -50,
                    style: {
                        fontWeight: 'bold',
                        color: 'white',
                        textShadow: '0px 1px 2px black'
                    }
                },
                startAngle: -90,
                endAngle: 90,
                center: ['50%', '75%']
            }
        },
        series: [{
            type: 'pie',
            name: 'Browser share',
            innerSize: '50%',
            data: [
                ['Firefox',   45.0],
                ['IE',       26.8],
                ['Chrome', 12.8],
                ['Safari',    8.5],
                ['Opera',     6.2],
                {
                    name: 'Others',
                    y: 0.7,
                    dataLabels: {
                        enabled: false
                    }
                }
            ]
        }]
    });
});

有什么方法可以让它与GWT Highcharts一起工作吗?

我认为Highcharts版本可能有问题,根据2.3.4支持它。没有2.3.4版本,应该有2.3.5版本

Highstock 1.2.4是在Highcharts 2.3.3和2.3.5之间发布的版本。您是否有机会将Highstock更新为1.2.5?在1.2.5中,它得到了肯定的支持