一些高级图表类别由于未知原因而丢失

时间:2014-01-20 00:21:09

标签: javascript highcharts

我遇到了一个highcharts脚本的问题。到目前为止我已经使用过几次了,我没有碰到这个问题。它似乎不想显示我列出的一些类别(Y轴)。我注意到它们没有正确放置,它们的坐标是关闭的(x = 0,y = -9999)。难道我做错了什么?这可以很容易修复,还是一个他们必须解决的错误?

JsFiddle:http://jsfiddle.net/E6cc3/

        $(function () {
        $('#questionsBx').highcharts({
            chart: {
                type: 'bar'
            },
            title: {
                style: {
                    color: '#8EC526',
                    font: 'normal 16px font-family: "Open Sans", sans-serif;'
                },
                text: 'Performance per Question Dec 19 2013 - Jan 21 2014'
            },
            xAxis: {
                categories: ["Was your call answered promptly?","How helpful and knowledgeable was the staff in making your reservation?","What was the level of courtesy and professionalism of the staff answering the phone?","Was the Chauffeur on time for your pickup?","Was the Chauffeur's appearance neat and professional?","Did the Chauffeur open the door for you?","Did the Chauffeur assist you with your luggage?","Was the Chauffeur prepared and familiar with the itinerary?","Was the amount of talking by the Chauffeur appropriate?","Did the Chauffeur drive you in a safe, comfortable manner?","What was the level of courtesy and professionalism of the Chauffeur providing services?","Was the vehicle clean inside and out?","What was your overall level of satisfaction pertaining to the vehicle?","How would you rate your overall experience?"]
            },
            yAxis: {
                min: 0,
                title: {
                    text: 'Performance per Question'
                }
            },
            legend: {
                backgroundColor: '#FFFFFF',
                reversed: true
            },
            plotOptions: {
                series: {
                    stacking: 'normal'
                }
            },
                series: [{
                name: 'Below Expectations',
                data: [2,1,2,1,2,2,1,1,1,1,1,2,1,2]
            }, {
                name: 'Met Expectations',
                data: [0,4,3,2,2,1,1,2,2,4,2,1,4,2]
            }, {
                name: 'Above Expectations',
                data: [6,3,3,5,3,4,4,3,3,3,4,5,3,4]
            }]
        });
    });

感谢您的时间!

1 个答案:

答案 0 :(得分:2)

图表本身的尺寸很小,以适应类别标题。要么使类别标题更小以适应图表区域,要么增加图表的高度。

例如。更改图表高度: http://jsfiddle.net/E6cc3/4/

chart: {
                type: 'bar',
                height: 1000
            },

或者例如。更改标题:

use : Level of courtesy and professionalism in chauffeur services 

instead of : What was the level of courtesy and professionalism of the Chauffeur providing services