如何将高图图例分页与图例的右侧或左侧对齐?

时间:2019-11-21 05:47:45

标签: highcharts highcharts-ng angular2-highcharts

我想将图例分页移动到图例的右侧或左侧

Fiddle link

  "legend":{
  "enabled":true,
  "maxHeight":50,
  "itemMarginTop":5,
  "navigation":{
     "activeColor":"#1d4659",
     "animation":true,
     "inactiveColor":"rgba(29, 70, 89, 0.5)"
  }

Sample chart

1 个答案:

答案 0 :(得分:0)

您可以包装scroll方法并根据需要定位箭头:

(function(H) {
    H.wrap(H.Legend.prototype, 'scroll', function(proceed) {
        proceed.apply(this, Array.prototype.slice.call(arguments, 1));
        this.nav.attr({
            translateY: 10,
            translateX: 390
        });
    });
}(Highcharts));

实时演示: http://jsfiddle.net/BlackLabel/25ahwq1k/

文档: https://www.highcharts.com/docs/extending-highcharts/extending-highcharts