2016-11-14 20 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。 –