2013-01-04 70 views
0

我是這個論壇的新成員,有兩個問題。如何在HIGHCHARTS中刪除x軸和框架之間的間隙並將系列標籤設置爲單行

  • 我只是想知道,如果我們可以在高圖表中消除軸背後的差距。我在API中沒有找到任何選項。

  • 如何獲得單行標籤。

我無法發佈圖片,因爲我是新用戶。

<!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() { 
var chart; 
$(document).ready(function() { 
    chart = new Highcharts.Chart({ 
     chart: { 
      renderTo: 'container', 
      type: 'bar' 
     }, 
     title: { 
      text: '' 
     }, 
     xAxis: { 
      gridLineWidth: 0, 
      categories: ['Deutsche-FR Bank', 'Barelays-LDN', 'HSBC-SG', 'Citi-NY'], 
      minorTickLength: 0, 
      tickLength: 0, 
      labels: { 
       align: 'left', 
       x: 2, 
       y: 7,   
       color: '#2257D6', 
       style: { 
        color: '#000', 
        font: '11px Trebuchet MS, Verdana, sans-serif' 
       } 
      }, 
      title: { 
       text: null 
      } 
     }, 
     yAxis: { 
      min: 0, 
      gridLineWidth: 0, 
      title: { 
       text: '', 
       align: 'high', 
       color: '#333' 
      }, 
      labels: { 
       enabled: false, 
       overflow: 'justify' 
      } 
     }, 
     tooltip: { 
      formatter: function() { 
       return ''+ 
        this.series.name +': '+ this.y +''; 
      } 
     }, 
     plotOptions: { 
      bar: { 
       borderWidth: 0.0, 
       pointWidth: 22, 
       dataLabels: { 
        enabled: false 
       }     
      }, 
      series: { 
       shadow: false 
      } 
     },   
     legend: { 
      layout: 'vertical', 
      align: 'right', 
      verticalAlign: 'top', 
      x: -100, 
      y: 100, 
      floating: false, 
      borderWidth: 1, 
      backgroundColor: '#FFFFFF', 
      shadow: true, 
      visible : false, 
      enabled: false 
     }, 
     credits: { 
      enabled: false 
     }, 
     series: [{ 
      name: 'Count', 
      data: [82,323,245,350], 
      color: '#2AAA00', 
      borderWidth: 0, 
      plotShadow: false, 
      plotBorderWidth: 0 
     }] 
    }); 
}); 

}); 
    </script> 
</head> 
<body> 
<script src="http://code.highcharts.com/highcharts.js"></script> 

<div id="container" style="width:220px;height:145px;overflow:auto"></div> 

</body> 

+0

你有一個圖像或示例網站,你可以設置顯示你是什麼意思? – wergeld

回答

0
How to get the series label in single line 

對於這一點,你需要使用屬性Rotation作爲

rotation: 90 

檢查API

設置該屬性也會回答你的問題1.

這裏您可以找到Demo

相關問題