2

現在、コードにHighchartsがあり、JavaScriptを使用して、JSONオブジェクトを作成してデータをマッサージしました。コードスニペットは次のようになります。

var yearChartOptions = {
    chart: {
        renderTo: 'YearChartContainer',
        type: 'column',
        margin: [ 50, 50, 50, 50]
    },
    title: {
        text: ''
    },
    xAxis: {
        categories: [],
        labels: {
            rotation: -90,
            align: 'right'
        }
    },
    yAxis: {
        title: {
            text: ''
        },
        plotLines: [{
            color: '#FF0000',
            width: 2,
            label: {
                style: {
                    color: 'blue',
                    fontWeight: 'bold',
                    zIndex: -1
                },
                formatter: function () {
                    return '$' + Highcharts.numberFormat(this.value/1000, 0) +'k ';
                }
            },
            zIndex: 10
        }]
    },
};

// Create the chart
var yearChart = new Highcharts.Chart(yearChartOptions);

TypeScriptで同じJavaScript結果を得るにはどうすればよいですか?

4

1 に答える 1

4

ファイルにタグを追加し/// <reference path="highcharts.d.ts" />ます。DefinitelyTypedからファイルを取得できます。すべてがそこから機能するはずです。

于 2013-02-14T01:27:59.600 に答える