4

Google ビジュアライゼーションの LineChartを使用してデータを表示しています (動作します)。

グラフはパフォーマンス テストの結果を示しており、それらの結果は一定の値を超えてはなりません(たとえば、応答時間は 20 ミリ秒を超えてはなりません)。新しい(ダミーの)一連のデータを追加することなく、その最大値(私が推測する水平線)を描画したいと思います。

それは可能ですか?

どうもありがとう、

アルバン

4

1 に答える 1

7

いいえ、別の一連のデータを追加せずに別の行を追加することはできませんが、手動で追加する必要はありません。DataView で十分に計算できます。

var maxResponseTime = 20;
var view = new google.visualization.DataView(data);
view.setColumns([0, 1[, 2, 3, 4.... /* specify all of your existing columns here */, {
    type: 'number',
    calc: function () {
        return maxResponseTime;
    }
}]);

var chart = new google.visualization.LineChart(...);
chart.draw(view, {
    // options
    series: {
        // "n" should be the series index of the max line
        // typically this is column index - 1,
        // so if you have one domain column, one data series
        // and the max line, it would be:
        1: {
            visibleInLegend: false, // set this if you don't want it in the legend
            enableInteractivity: false // set this if you don't want the line to spawn tooltips
        }
    }
});
于 2013-08-01T16:34:00.523 に答える