2016-11-14 50 views
0

我只是想表明表只是X轴柱下方图表(各条),我知道分组可以创建表,但我不我想要分组来使用。只需要X轴表格就可以了。如在下面所示的图像,我可以显示在X轴工作台像分组类别highcharts - 但是,没有分组

我能做到这一点使用highcharts性质。只有表格会出现在x轴标签上。

使用highcharts lib中是否有可能?

enter image description here

+0

像[本](http://www.highcharts.com/demo/column-parsed)? –

+0

号你在x轴完全一样观看图像表。 –

+0

http://jsfiddle.net/BlackLabel/TFhd7/?utm_source=website&utm_medium=embed&utm_campaign=TFhd7 –

回答

0

您可以通过设置xAxis.tickLength财产蜱更长。 然后,呈现刻度线的底部的附加导线。

function renderBottomLine() { 
    var chart = this, 
     axis = chart.xAxis[0], 
     line = axis.bottomLine, 
     x1 = chart.plotLeft, 
     y = chart.plotTop + chart.plotHeight + axis.options.tickLength, 
     x2 = x1 + chart.plotWidth, 
     path = [ 
     'M', x1, y, 
     'L', x2, y 
     ]; 

    if (!line) { 
    axis.bottomLine = chart.renderer.path(path).attr({ 
     'stroke-width': 1, 
     stroke: '#ccd6eb' 
    }). 
    add(); 
    } else { 
    line.animate({ 
     d: path 
    }); 
    } 
} 

Highcharts.chart('container', { 
     chart: { 
      events: { 
      load: renderBottomLine, 
      redraw: renderBottomLine 
      } 
     }, 

例如:http://jsfiddle.net/xuyyt6nd/

+0

谢谢@morganfree。 –