且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在没有webservices的情况下使用highchart来创建图表

更新时间:2022-11-02 23:23:05

对于 SQL Server 示例,请参阅: C#中的HighCharts数据绑定 [ ^ ]



这是一个纯HTML示例:

For an SQL Server example, see: HighCharts databinding in C#[^]

Here is a pure HTML example:
DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>Bar Chart</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="http://code.highcharts.com/highcharts.js" type="text/javascript"></script>
      <script src="http://code.highcharts.com/modules/exporting.js" type="text/javascript"></script>

      <script type="text/javascript">


(function(){
(function() {


('# container')。highcharts({
chart:{
type:'bar'
},
title:{
text:'MyFruit database info'
},
xAxis:{
类别:['记录','碎片','用户']
},
yAxis:{
title:{
text:'values'
}
},
series:[
{
name:'MyFruit_Sites',
data:[10, 50,4]
},{
名称:'MyFruit_Devices',
数据:[50 0,80,3]
}
]
});

//按钮处理程序
('#container').highcharts({ chart: { type: 'bar' }, title: { text: 'MyFruit database info' }, xAxis: { categories: ['Records', 'Fragmentation', 'Users'] }, yAxis: { title: { text: 'Values' } }, series: [ { name: 'MyFruit_Sites', data: [10, 50, 4] }, { name: 'MyFruit_Devices', data: [500, 80, 3] } ] }); // the button handler