2017-07-14 66 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