jquery用jqplot外掛畫圖例子
$.jqplot.config.enablePlugins = true;
l1 = [2, 3, 1, 4, 3];
l2 = [1, 4, 3, 2, 5];
line1=[['2008-09-30', 4], ['2008-10-30', 6.5], ['2008-11-30', 5.7], ['2008-12-30', 9], ['2009-01-30', 8.2]];
line2=[['2008-09-30', 3], ['2008-10-30', 5.5], ['2008-11-30', 5.7], ['2008-12-30', 10], ['2009-01-30', 9.2]];
plot2 = $.jqplot('chart2', [line1,line2], {
title:'Rotated Axis Text',
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
min:'August 30, 2008',
tickInterval:'1 month',
rendererOptions:{
tickRenderer:$.jqplot.CanvasAxisTickRenderer},
tickOptions:{formatString:'%b %#d, %Y', fontSize:'10pt', fontFamily:'Tahoma', angle:-40, fontWeight:'normal', fontStretch:1}
}
},
series:[{lineWidth:4, markerOptions:{style:'square'}}]
});
line1 = [[4, 1], [4, 2], [3, 3], [16, 4]];
line2 = [[3, 1], [7, 2], [4, 3], [3.125, 4]];
plot3 = $.jqplot('chart3', [line1, line2], {
//stackSeries: true,
legend: {
show: true,
location: 'se'
},
title: '條形圖',
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barDirection: 'horizontal',
barPadding: 6,
barMargin: 10
}
},
series: [{
label: '1st Qtr'
},
{
label: '2nd Qtr'
}],
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ['Q1', 'Q2', 'Q3', 'Q4']
},
xaxis: {min: 0, max: 20, numberTicks:5}
}
});
line1 = [[4, 1], [4, 2], [3, 3], [16, 4]];
line2 = [[3, 1], [7, 2], [4, 3], [3.125, 4]];
plot3 = $.jqplot('chart3d', [line1, line2], {
stackSeries: true,
legend: {
show: true,
location: 'se'
},
title: '條形圖',
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barDirection: 'horizontal',
barPadding: 6,
barMargin: 40
}
},
series: [{
label: '1st Qtr'
},
{
label: '2nd Qtr'
}],
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ['Q1', 'Q2', 'Q3', 'Q4']
},
xaxis: {min: 0, max: 20, numberTicks:5}
}
});
line1 = [4, 2, 9, 16];
line2 = [3, 7, 6.25, 3.125];
plot3b = $.jqplot('chart3b', [line1, line2], {
stackSeries: true,
legend: {
show: true,
location: 'nw'
},
title: '柱狀圖1',
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barPadding: 6,
barMargin: 40
}
},
series: [{
label: '1st Qtr'
},
{
label: '2nd Qtr'
}],
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ['Q1', 'Q2', 'Q3', 'Q4']
},
yaxis: {min: 0, max: 20, numberTicks:5}
}
});
line1 = [4, 2, 9, 16];
line2 = [3, 7, 6.25, 3.125];
plot3c = $.jqplot('chart3c', [line1, line2], {
legend: {
show: true,
location: 'nw'
},
title: '柱狀圖2',
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barPadding: 6,
barMargin: 20
}
},
series: [{
label: '1st Qtr'
},
{
label: '2nd Qtr'
}],
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ['Q1', 'Q2', 'Q3', 'Q4']
},
yaxis: {min: 0, max: 20, numberTicks:5}
}
});
//
line1 = [['item1', 3], ['item2', 7], ['item3', 2.5], ['item4', 6], ['item5', 5], ['item6', 4]];
line2 = [3, 7, 2.5, 6, 5, 4];
plot4 = $.jqplot('chart4', [line1], {
title: '餅圖1',
seriesDefaults:{renderer:$.jqplot.PieRenderer},
legend:{show:true}
});
line1 = [['item1', 3], ['item2', 7], ['item3', 2.5], ['item4', 6], ['item5', 5], ['item6', 4]];
line2 = [3, 7, 2.5, 6, 5, 4];
plot4 = $.jqplot('chart4b', [line1], {
title: '餅圖2',
seriesDefaults:{renderer:$.jqplot.PieRenderer, rendererOptions:{sliceMargin:4}},
legend:{show:true}
});
l1 = [2.2, 3, .6, 4.8, 3];
l2 = [1, 4, 3, 2, 5.7];
l3 = [1, 5, 6, 7, 5.7];
plot5 = $.jqplot('chart5', [l1, l2,l3]);
l1 = [2, 3, 1, 4, 3];
l2 = [1, 4, 3, 2, 5];
line1=[['2008-09-30', 4], ['2008-10-30', 6.5], ['2008-11-30', 5.7], ['2008-12-30', 9], ['2009-01-30', 8.2]];
line2=[['2008-09-30', 3], ['2008-10-30', 5.5], ['2008-11-30', 5.7], ['2008-12-30', 10], ['2009-01-30', 9.2]];
plot2 = $.jqplot('chart2', [line1,line2], {
title:'Rotated Axis Text',
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
min:'August 30, 2008',
tickInterval:'1 month',
rendererOptions:{
tickRenderer:$.jqplot.CanvasAxisTickRenderer},
tickOptions:{formatString:'%b %#d, %Y', fontSize:'10pt', fontFamily:'Tahoma', angle:-40, fontWeight:'normal', fontStretch:1}
}
},
series:[{lineWidth:4, markerOptions:{style:'square'}}]
});
line1 = [[4, 1], [4, 2], [3, 3], [16, 4]];
line2 = [[3, 1], [7, 2], [4, 3], [3.125, 4]];
plot3 = $.jqplot('chart3', [line1, line2], {
//stackSeries: true,
legend: {
show: true,
location: 'se'
},
title: '條形圖',
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barDirection: 'horizontal',
barPadding: 6,
barMargin: 10
}
},
series: [{
label: '1st Qtr'
},
{
label: '2nd Qtr'
}],
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ['Q1', 'Q2', 'Q3', 'Q4']
},
xaxis: {min: 0, max: 20, numberTicks:5}
}
});
line1 = [[4, 1], [4, 2], [3, 3], [16, 4]];
line2 = [[3, 1], [7, 2], [4, 3], [3.125, 4]];
plot3 = $.jqplot('chart3d', [line1, line2], {
stackSeries: true,
legend: {
show: true,
location: 'se'
},
title: '條形圖',
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barDirection: 'horizontal',
barPadding: 6,
barMargin: 40
}
},
series: [{
label: '1st Qtr'
},
{
label: '2nd Qtr'
}],
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ['Q1', 'Q2', 'Q3', 'Q4']
},
xaxis: {min: 0, max: 20, numberTicks:5}
}
});
line1 = [4, 2, 9, 16];
line2 = [3, 7, 6.25, 3.125];
plot3b = $.jqplot('chart3b', [line1, line2], {
stackSeries: true,
legend: {
show: true,
location: 'nw'
},
title: '柱狀圖1',
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barPadding: 6,
barMargin: 40
}
},
series: [{
label: '1st Qtr'
},
{
label: '2nd Qtr'
}],
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ['Q1', 'Q2', 'Q3', 'Q4']
},
yaxis: {min: 0, max: 20, numberTicks:5}
}
});
line1 = [4, 2, 9, 16];
line2 = [3, 7, 6.25, 3.125];
plot3c = $.jqplot('chart3c', [line1, line2], {
legend: {
show: true,
location: 'nw'
},
title: '柱狀圖2',
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barPadding: 6,
barMargin: 20
}
},
series: [{
label: '1st Qtr'
},
{
label: '2nd Qtr'
}],
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ['Q1', 'Q2', 'Q3', 'Q4']
},
yaxis: {min: 0, max: 20, numberTicks:5}
}
});
//
line1 = [['item1', 3], ['item2', 7], ['item3', 2.5], ['item4', 6], ['item5', 5], ['item6', 4]];
line2 = [3, 7, 2.5, 6, 5, 4];
plot4 = $.jqplot('chart4', [line1], {
title: '餅圖1',
seriesDefaults:{renderer:$.jqplot.PieRenderer},
legend:{show:true}
});
line1 = [['item1', 3], ['item2', 7], ['item3', 2.5], ['item4', 6], ['item5', 5], ['item6', 4]];
line2 = [3, 7, 2.5, 6, 5, 4];
plot4 = $.jqplot('chart4b', [line1], {
title: '餅圖2',
seriesDefaults:{renderer:$.jqplot.PieRenderer, rendererOptions:{sliceMargin:4}},
legend:{show:true}
});
l1 = [2.2, 3, .6, 4.8, 3];
l2 = [1, 4, 3, 2, 5.7];
l3 = [1, 5, 6, 7, 5.7];
plot5 = $.jqplot('chart5', [l1, l2,l3]);
相關文章
- 推薦一個挺好用的jquery外掛,jquery.jqplot.js(畫圖),此處簡略得說一下折線圖的畫法jQueryJS
- JQuery蜂巢圖外掛jQuery
- JQuery 導航外掛和圖表jQuery
- jQuery外掛jQuery
- Maplace.js – 小巧實用的 jQuery 谷歌地圖外掛JSjQuery谷歌地圖
- jQuery Ajax應用與常用外掛jQuery
- jquery圖片上傳外掛HHuploadifyjQuery
- 10 個 jQuery 圖表外掛推薦jQuery
- Uploadify(JQuery上傳外掛)在asp.net中使用例子jQueryASP.NET
- jquery 外掛站jQuery
- 精美實用的jQuery外掛精選jQuery
- 5 款最新的 jQuery 圖片裁剪外掛jQuery
- 8個用於圖片展示的jQuery外掛及教程推薦jQuery
- 8個超實用的jQuery外掛應用jQuery
- JQuery模板外掛-jquery.tmpljQuery
- JQuery外掛:圖片上傳本地預覽外掛,改進案例一則。jQuery
- jQuery的外掛列表jQuery
- jQuery外掛推薦jQuery
- jquery分頁外掛jQuery
- jquery外掛寫法jQuery
- 9款jQuery帶縮圖焦點圖外掛賞析jQuery
- 13款精彩實用的最新jQuery外掛jQuery
- 15個超級實用的jQuery外掛jQuery
- 10個超實用jquery外掛資源jQuery
- 5款好用的開源JS圖片裁剪外掛(3個jQuery外掛,2個AngularJS外掛)JSjQueryAngular
- 炫酷實用的jQuery外掛 涵蓋選單、按鈕、圖片jQuery
- jQuery表單外掛jQuery.formjQueryORM
- 24個最受歡迎的jQuery畫廊和幻燈片外掛jQuery
- 實用的 jQuery下拉選擇框外掛集合jQuery
- 27款很實用的 jQuery 表單外掛jQuery
- 14款華麗的最新jQuery焦點圖動畫外掛jQuery動畫
- 前端不容錯過的jQuery圖片滑塊外掛前端jQuery
- 帶水平滑桿的jQuery焦點圖動畫外掛jQuery動畫
- jQuery擴充套件外掛jQuery套件
- jQuery外掛擴充套件jQuery套件
- jquery日曆外掛SimpleCalendarjQuery
- jQuery外掛開發模式jQuery模式
- jquery--uploadify 外掛jQuery