删除AmCharts中的灰色标题框

时间:2015-05-27 14:45:35

标签: javascript charts 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
        });

1 个答案:

答案 0 :(得分: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
});