0

私は、Highcharts v3.0.2 の新しいしきい値/負の色機能を、本質的に「毎秒更新するスプライン」の例に適用しようとしています。

チャート更新のアニメーション中に、シリーズ ラインに奇妙なアーティファクトが表示されます。別のコントロール ポイントのセットにアニメーション化されているように見えます。その後、アニメーション (新しいデータの点入り)を行います。

threshold/negativeColor 機能をコメント アウトすると、この視覚的なアーティファクトがなくなります。

バグがありますか?

更新:次のコードを例として投稿しています。これは、私が追加したしきい値/色/負の色の行 (シリーズの下の最初の行) を含むストック ハイチャート デモ (私のローカル jquery は v1.10.2) です。このコードは動作がおかしいようです。

<html>
<head>
<script src="js/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>

<script>
$(function () {
    $(document).ready(function() {
        Highcharts.setOptions({
            global: {
                useUTC: false
            }
        });

        var chart;
        $('#container').highcharts({
            chart: {
                type: 'spline',
                animation: Highcharts.svg, // don't animate in old IE
                marginRight: 10,
                events: {
                    load: function() {

                        // set up the updating of the chart each second
                        var series = this.series[0];
                        setInterval(function() {
                            var x = (new Date()).getTime(), // current time
                                y = Math.random();
                            series.addPoint([x, y], true, true);
                        }, 1000);
                    }
                }
            },
            title: {
                text: 'Live random data'
            },
            xAxis: {
                type: 'datetime',
                tickPixelInterval: 150
            },
            yAxis: {
                title: {
                    text: 'Value'
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            },
            tooltip: {
                formatter: function() {
                        return '<b>'+ this.series.name +'</b><br/>'+
                        Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) +'<br/>'+
                        Highcharts.numberFormat(this.y, 2);
                }
            },
            legend: {
                enabled: false
            },
            exporting: {
                enabled: false
            },
            series: [{
                threshold: 0.5,
                color: '#FF0000',
                negativeColor: '#00FF00',
                name: 'Random data',
                data: (function() {
                    // generate an array of random data
                    var data = [],
                        time = (new Date()).getTime(),
                        i;

                    for (i = -19; i <= 0; i++) {
                        data.push({
                            x: time + i * 1000,
                            y: Math.random()
                        });
                    }
                    return data;
                })()
            }]
        });
    });

});
</script>
</head>

<body>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
</body>
</html>
4

1 に答える 1