0

ハイストックツールチップでは、特定のポイントのデータを表示する必要があります。

これは私がそれを行う方法です:

tooltip: {
            formatter: function() {
                var s = '<b>'+ Highcharts.dateFormat('%A, %b %e, %Y', this.x) +'</b>';
                s += '<br/>Time: '+ Highcharts.dateFormat('%H:%mu', this.x);

                if(this.point)
                {
                    s += "<br/>this is a flag on " + new Date(this.point.x).toDateString();
                }
                else
                {
                    s += '<br/>Price: '+ this.points[0].y +' EUR';
                    s += '<br/>Ask: '+ this.points[0].point.ask +' EUR';
                    s += '<br/>Bid: '+ this.points[0].point.bid +' EUR';
                    console.log(this.points[0].point);
                }

                return s;
            }

        },

ポイントにカーソルを合わせると、その特定のポイントに関する詳細情報が表示されます。

s += '<br/>Price: '+ this.points[0].y +' EUR';
s += '<br/>Ask: '+ this.points[0].point.ask +' EUR';
s += '<br/>Bid: '+ this.points[0].point.bid +' EUR';

これは、ズーム(範囲セレクター)がYTD以下に設定されている場合にうまくいきます。

奇妙なことに、ズームを1yまたはAllに設定すると、this.points[0].point.消えてしまいます。設定したアスクとビッドの値が見つかりません。

私の説明が明確であることを願っています。

問題が解決しました:

dataGrouping : {
    enabled: false
}
4

1 に答える 1