0

フラグ付きのHighstockチャートがあります。すべて問題ありませんが、フラグのツールチップの位置を変更したいと思いました。(フラグのツールチップをフラグの上側に移動します)。また、新しいタブで開くフラグテキスト「テストテスト」へのリンクを提供したいと思います。誰か助けてもらえますか?これは私の完全なコードhttp://jsfiddle.net/anant_ghate/8byc9/1/

// Create the chart
    window.chart = new Highcharts.StockChart({
        chart: {
            renderTo: 'container'
        },
        tooltip: {
            positioner: function(boxWidth, boxHeight, point) {
                return {
                    x: point.plotX + 20,
                    y: point.plotY + -20
                };
            },
            shared:true,
            formatter: function(){
                    var p = '';
                    if(this.point) {
                      p += '<span>'+ Highcharts.dateFormat('%A, %b %e, %Y', this.point.x) +'</span><br/>';
                      p += '<b>'+ this.point.title + '</b>' // This will add the text on the flags
                    }
                    else {              
                      p += '<b>'+ Highcharts.dateFormat('%A, %b %e, %Y', this.x) +'</b><br/>';
                      $.each(this.points, function(i, series){
                        p += '<span style="color:' + this.series.color + '">' + this.series.name + '</span>: <b>'+ this.y;
                      });

                    }
                    return p;
            },              
        },
        rangeSelector: {
            selected: 1
        },

        title: {
            text: 'USD to EUR exchange rate'
        },

        yAxis: {
            title: {
                text: 'Exchange rate'
            }
        },

        series: [{
            name: 'USD to EUR',
            data: data,
            id: 'dataseries',
            tooltip: {
                yDecimals: 4
            }
        }, {
            type: 'flags',
            data: [{
                x: Date.UTC(2011, 1, 20),
                title: 'Test test'
            }, {
                x: Date.UTC(2011, 3, 20),
                title: 'Test test'
            }],
            onSeries: 'dataseries',
            allowPointSelect : true,
            shape: 'squarepin',
            y : -40         
        }]
    });
4

2 に答える 2

0

この回答のようにツールチップを微調整できますハイチャートのツールチップは常にカーソルの右側にあります

そして、このhighcharts clickable labels how to goto anchor に似たアプローチでフラグをクリック可能にします

于 2012-09-08T09:27:12.190 に答える
0

フラグをクリックしたときに URL にリダイレクトするには、「クリック イベント」で関数を作成できます : http://jsfiddle.net/8byc9/5/ flag-tooltip ですが、currencytooltip ではありません...

于 2012-09-10T08:31:59.270 に答える