【HighCharts系列教程】八、Html標籤屬性——Labels

來源:互聯網
上載者:User

標籤:

一、labels屬性說明

Labels屬性允許在HighCharts圖表的任意位置添加任意的html代碼。可以實現許多自訂內容。

二、labels屬性詳解

 

參數 子參數 說明 預設值
items —- 一個html標籤 —-
—- html html代碼 “”
—- style 標籤位置(只能是位置,其他css不行) style: {
left: ’100px’,
top: ’100px’
}
style —- 標籤的顏色(這裡的style和items中的style不同) style: {
color: ‘#3E576F’
} 

 

三、執行個體說明

 

<html>    <head>        <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript"> $(function () { var chart; $(document).ready(function() { chart = new Highcharts.Chart({ chart: { renderTo: ‘container‘, type: ‘areaspline‘, }, credits : { enabled:false//不顯示highCharts著作權資訊 }, labels:{ items:[{ //標籤代碼(html代碼) html:‘<p style="font-size:20">Copyright © 2012-2013 </p><a href="http://www.52wulian.org" style="font-size:20;text-decoration: underline;">我愛物聯網</a>‘, style:{ //設定標籤位置 left:‘100px‘, top:‘50px‘, } }], style:{ //設定標籤顏色 color:‘rgb(0,0,255)‘ } }, xAxis: { categories: [‘2011-11‘,‘2011-12‘,‘2012-01‘,‘2012-02‘,‘2012-03‘] }, series: [{ name: ‘series1‘, data: [2,4,5,9,2] },{ name:‘series2‘, data:[3,5,7,2,1] }] }); }); }); </script> </head> <body> <script src="js/highcharts.js"></script> <script src="js/exporting.js"></script> <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div> </body></html>
四、效果

五、線上示範示範地址:http://www.52wulian.org/test/HighCharts/highcharts_2_6_labels.html六、資源下載本例源檔案:http://pan.baidu.com/share/link?shareid=248660&uk=3087605183

 

【HighCharts系列教程】八、Html標籤屬性——Labels

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.