0

我有这张图:http: //jsfiddle.net/ZKGZb/

$(document).ready(function() {
    chart16 = new Highcharts.Chart({
    "chart": {
        "renderTo": "right-22",
        "type": "column",
        "width": 550,
        "height": 400,

    },
    "xAxis": {
        "categories": ["a very long long text ", "2another long text", "dda", "bbb", "aaa"],
        "allowDecimals": "0",
        "title": {
            "text": "Hello world",
            "offset": -350,
            "align": "left",
            "style": {
                "color": "red"
            }
        },    

        "labels":{"useHtml": true       }
    },
    "yAxis": {
        "allowDecimals": false,
        "labels": {
            "overflow": "justify"
        },
        "title": {
            "text": " "
        },
        "max": 20
    },
    "tooltip": {
        "formatter": function() {
            return this.series.name + this.y + "";
        }
    },
    "title": {
        "text": "a very long long text",
        "margin": 50
    },
    "plotOptions": {
        "column": {
            "groupPadding": null,
            "borderWidth": null,
            "dataLabels": {
                "enabled": null,
                "color": null,
                "style": {
                    "fontSize": null,
                    "font-weight": "bold"
                },
                "formatter": function() {
                    return this.series.name + this.y + "";
                }
            }
        }
    },
    "exporting": {
        "enabled": false
    },
    "credits": {
        "enabled": false
    },
    "labels": {
        "enabled": null
    },
    "legend": {
        "enabled": 0,
        "layout": "vertical",
        "align": "top",
        "verticalAlign": "top",
        "y": 0,
        "x": 0,
        "floating": false,
        "borderWidth": 1,
        "backgroundColor": "#FFFFFF",
        "shadow": true
    },
    "series": [{
        "data": [{
            "y": 19,
            },
        {
            "y": 0,
            "name": ""},
        {
            "y": 0,
            "name": ""},
        {
            "y": 1,
            "name": ""},
        {
            "y": 0,
            "name": ""}],
        "name": "Total: "}]
}, function(chartObj) {});
});

如何使类别标签看起来不错?我需要能够显示每个类别的整个文本,但我找不到方法来做到这一点。我尝试添加
和使用“useHtml”选项,但它没有工作提前谢谢

4

1 回答 1

0
"xAxis": {
    "categories": ["a very long long text ", "2another long text", "dda", "bbb", "aaa"],
    "allowDecimals": "0",
    "title": {
        "text": "Hello world",
        "offset": -350,
        "align": "left",
        "style": {
            "color": "red"
        }
    },    

删除“title=>offset”修复它..

于 2012-11-30T20:56:54.237 回答