2015-05-27 41 views
0

在圖表上繪製一些歷史數據時,我偶然發現了這個令人討厭的灰色框,我無法擺脫它。刪除AmCharts中的灰色標題框

基本上我從這個例子開始:http://www.amcharts.com/demos/date-based-data/並做了一些微小的修改(刪除chartScrollbar)。

該圖表正在使用類型:系列與主題:

在文檔http://docs.amcharts.com/3/javascriptcharts/中仍然沒有找到類似於此的任何內容。

我試過'指南','圖表','chartScrollBar',但似乎沒有任何工作。

欣賞此中的任何幫助。

圖表用灰色標頭盒:

Gray box

AmCharts CONF:

 chart = AmCharts.makeChart("chartdiv", { 
      "type": "serial", 
      "theme": "light", 
      "marginLeft": 0, 
      "marginRight": 0, 
      "autoMarginOffset": 0, 
      "path": "http://www.amcharts.com/lib/3/", 
      "dataDateFormat": "YYYY-MM-DD", 
      "valueAxes": [{ 
       "id": "v1", 
       "axisAlpha": 0, 
       "position": "left" 
      }], 
      "balloon": { 
       "borderThickness": 1, 
       "shadowAlpha": 0 
      }, 
      "graphs": [{ 
       "id": "g1", 
       "bullet": "round", 
       "bulletBorderAlpha": 1, 
       "bulletColor": "#FFFFFF", 
       "bulletSize": 5, 
       "hideBulletsCount": 50, 
       "lineThickness": 2, 
       "title": "red line", 
       "useLineColorForBulletBorder": true, 
       "valueField": "value", 
       "balloonText": "<div style='margin:5px; font-size:19px;'><span style='font-size:13px;'>[[category]]</span><br>[[value]]</div>" 
      }], 
      "chartScrollbar": { 
       "enabled": false 
      }, 
      "chartCursor": { 
       "pan": true, 
       "valueLineEnabled": true, 
       "valueLineBalloonEnabled": true, 
       "cursorAlpha": 0, 
       "valueLineAlpha": 0.2 
      }, 
      "categoryField": "date", 
      "categoryAxis": { 
       "parseDates": true, 
       "dashLength": 1, 
       "minorGridEnabled": true, 
       "position": "bottom" 
      }, 
      "export": { 
       "enabled": false 
      }, 
      "dataProvider": chartData 
     }); 
+0

似乎'啓用:假'應該工作。您可能需要爲此記錄支持憑單。在此之前,您可以使用'「scrollbarHeight」:0.1' – CodingIntrigue

回答

1

「灰色框」 是圖表滾動條。默認情況下,圖表不顯示滾動條。所以要刪除它只需將其從圖表配置完全刪除它:

chart = AmCharts.makeChart("chartdiv", { 
    "type": "serial", 
    "theme": "light", 
    "marginLeft": 0, 
    "marginRight": 0, 
    "autoMarginOffset": 0, 
    "path": "http://www.amcharts.com/lib/3/", 
    "dataDateFormat": "YYYY-MM-DD", 
    "valueAxes": [{ 
     "id": "v1", 
     "axisAlpha": 0, 
     "position": "left" 
    }], 
    "balloon": { 
     "borderThickness": 1, 
     "shadowAlpha": 0 
    }, 
    "graphs": [{ 
     "id": "g1", 
     "bullet": "round", 
     "bulletBorderAlpha": 1, 
     "bulletColor": "#FFFFFF", 
     "bulletSize": 5, 
     "hideBulletsCount": 50, 
     "lineThickness": 2, 
     "title": "red line", 
     "useLineColorForBulletBorder": true, 
     "valueField": "value", 
     "balloonText": "<div style='margin:5px; font-size:19px;'><span style='font-size:13px;'>[[category]]</span><br>[[value]]</div>" 
    }], 
    "chartCursor": { 
     "pan": true, 
     "valueLineEnabled": true, 
     "valueLineBalloonEnabled": true, 
     "cursorAlpha": 0, 
     "valueLineAlpha": 0.2 
    }, 
    "categoryField": "date", 
    "categoryAxis": { 
     "parseDates": true, 
     "dashLength": 1, 
     "minorGridEnabled": true, 
     "position": "bottom" 
    }, 
    "export": { 
     "enabled": false 
    }, 
    "dataProvider": chartData 
}); 
+0

完美,這是正確的解決方案! – ricardo

相關問題