chart : {
type : 'columnrange',
inverted : true
},
xAxis : {
categories : ['A', 'B', 'C', 'D', 'E', 'F', 'G']
},
我如何控制X轴的每个数据的高度???也就是说原来显示的是这样线

解决方案 »

  1.   


     plotOptions: {
                 series: {
                pointWidth: 10
            }
        },
      

  2.   

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Highcharts Example</title>
    <script type="text/javascript"
    src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script type="text/javascript">
    $(function() {
    Highcharts.setOptions({
    global : {
    useUTC : false
    }
    });
        
    $('#container').highcharts({

        chart: {
            type: 'columnrange',
            inverted: true
        },
        
        title: {
            text: 'Temperature variation by month'
        },
        
    subtitle: {
            text: 'Observed in Vik i Sogn, Norway, 2009'
        },

        xAxis: {
         categories : ['氧气', '注射', '盐酸右美托咪定注射液', '罗罗罗注射液', 'AAAAAA注射液', 'BBBB注射液', 'CCCCCC注射液', 'D注射液', 'E注射液'],
        },
        
        yAxis: {
            title: {
                text: '时间(分钟)'
            },
            min : (new Date("2013-08-08 07:00:00")).getTime(), // y轴的最大显示值
    max : (new Date("2013-08-08 14:00:00")).getTime(), // y轴的最小显示值
    endOnTick : true,
    type : "datetime"
        },

        tooltip: {
            valueSuffix: '',
            dateTimeLabelFormats: {
             minute: '%H:%M'
            }
        },
        
        plotOptions: {
            columnrange: {
             dataLabels: {
             enabled: true,
    formatter : function() {
    var ndate = new Date(this.y);
    return ndate.getHours() + ':' + ndate.getMinutes();
    }
             }
                   
            },
                //问题点:设置每个系列的宽度
                 series: {
                pointWidth: 5
            }
        },
        
        legend: {
            enabled: false
        },

        series: [{
    name : '用药时间',
    data : [
    [(new Date("2013-08-08 08:50:00")).getTime(), (new Date("2013-08-08 12:55:00")).getTime()], 
    [(new Date("2013-08-08 08:10:00")).getTime(),(new Date("2013-08-08 11:30:00")).getTime()], 
    [(new Date("2013-08-08 08:10:00")).getTime(), (new Date("2013-08-08 11:30:00")).getTime()], 
    [(new Date("2013-08-08 08:40:00")).getTime(), (new Date("2013-08-08 11:10:00")).getTime()], 
    [(new Date("2013-08-08 08:40:00")).getTime(), (new Date("2013-08-08 11:10:00")).getTime()], 
    [(new Date("2013-08-08 08:40:00")).getTime(), (new Date("2013-08-08 11:10:00")).getTime()], 
    [(new Date("2013-08-08 08:40:00")).getTime(), (new Date("2013-08-08 11:10:00")).getTime()], 
    [(new Date("2013-08-08 08:40:00")).getTime(), (new Date("2013-08-08 11:10:00")).getTime()], 
    [(new Date("2013-08-08 08:40:00")).getTime(), (new Date("2013-08-08 11:10:00")).getTime()], 
    [(new Date("2013-08-08 08:40:00")).getTime(), (new Date("2013-08-08 11:10:00")).getTime()], 
    [(new Date("2013-08-08 08:40:00")).getTime(), (new Date("2013-08-08 11:10:00")).getTime()], 
    [(new Date("2013-08-08 08:40:00")).getTime(), (new Date("2013-08-08 11:10:00")).getTime()]
    ]
                
        }]

    });
         });
    </script>
    </head>
    <body>
    <script src="../../js/highcharts.js"></script>
    <script src="../../js/highcharts-more.js"></script>
    <script src="../../js/modules/exporting.js"></script>
    <div id="container"
    style="min-width: 310px; margin: 0 auto; width: 29.7cm; padding: 10px"></div>
    </body>
    </html> 求解决
      

  3.   

    tooltip: {
                                valueSuffix: '',
                                
    formatter: function() {
                            return  '<b>' +
                                    Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.y)+'</b>' ;
                          }                        },
      

  4.   

    这个方法只能取到这个里面[(new Date("2013-08-08 08:50:00")).getTime(), (new Date("2013-08-08 12:55:00")).getTime()]第一个值,显示不了第二个值
      

  5.   

    http://jsfiddle.net/z6KAD/   鼠标移上去的时候显示的是毫秒数,求解决
      

  6.   


    tooltip: {
              valueSuffix: '',
                        
              formatter: function() {
                            return  '<b>' +
                                    Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.y) +" o哎呀呀怕怕o "+Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.point.high) ;'</b>' ;
                          }                        },