2017-07-14 63 views
0

我想使5M作为我的默认rangeSelector,但它似乎坚持选择器上的'全部'。无法更改默认rangeSelection Highstock

rangeSelector: { 
      enabled: true, 
      buttons: [{ 
        count: 2, 
        type: 'minute', 
        text: '2M' 
       }, { 
        count: 5, 
        type: 'minute', 
        text: '5M' 
       }, { 
        count: 15, 
        type: 'minute', 
        text: '15M' 
       }, { 
        count: 30, 
        type: 'minute', 
        text: '30M' 
       }, { 
        count: 3, 
        type: 'hour', 
        text: '3H' 
       }, { 
        count: 1, 
        type: 'day', 
        text: '1D' 
       }, { 
        count: 30, 
        type: 'day', 
        text: '30D' 
       }, { 
        type: 'all', 
        text: 'All' 
       }], 
      selected: 5, 
     }, 

有人能告诉我我的代码出错了吗? 感谢您的帮助。

回答

0

我已经加入allButtonsEnabled固定我的问题:真正的和更改选择:。我刚刚有点困惑

rangeSelector: { 
      enabled: true, 
      allButtonsEnabled: true, 
      buttons: [{ 
        count: 2, 
        type: 'minute', 
        text: '2M' 
       }, { 
        count: 5, 
        type: 'minute', 
        text: '5M' 
       }, { 
        count: 15, 
        type: 'minute', 
        text: '15M' 
       }, { 
        count: 30, 
        type: 'minute', 
        text: '30M' 
       }, { 
        count: 3, 
        type: 'hour', 
        text: '3H' 
       }, { 
        count: 1, 
        type: 'day', 
        text: '1D' 
       }, { 
        count: 30, 
        type: 'day', 
        text: '30D' 
       }, { 
        type: 'all', 
        text: 'All' 
       }], 
      selected: 1, 
     }, 
+0

这将使按钮默认启用。你是否检查缩放是否在他们的工作。哟,请提供更新的jsfiddle? – Strikers