egroupware/phpgwapi/js/jquery/jqplot/examples/stackedBar2.html

126 lines
3.9 KiB
HTML
Raw Normal View History

2011-08-10 01:10:50 +02:00
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../jquery.jqplot.min.css" />
2011-08-10 01:10:50 +02:00
<link rel="stylesheet" type="text/css" href="examples.css" />
<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="../excanvas.js"></script><![endif]-->
<!-- BEGIN: load jquery -->
<script language="javascript" type="text/javascript" src="../jquery.min.js"></script>
2011-08-10 01:10:50 +02:00
<!-- END: load jquery -->
<!-- BEGIN: load jqplot -->
<script language="javascript" type="text/javascript" src="../jquery.jqplot.min.js"></script>
<script language="javascript" type="text/javascript" src="../plugins/jqplot.categoryAxisRenderer.min.js"></script>
<script language="javascript" type="text/javascript" src="../plugins/jqplot.dateAxisRenderer.min.js"></script>
<script language="javascript" type="text/javascript" src="../plugins/jqplot.barRenderer.min.js"></script>
<script language="javascript" type="text/javascript" src="../plugins/jqplot.pointLabels.min.js"></script>
<script language="javascript" type="text/javascript" src="../plugins/jqplot.enhancedLegendRenderer.min.js"></script>
2011-08-10 01:10:50 +02:00
<script type="text/javascript" language="javascript">
$(document).ready(function(){
$.jqplot.config.enablePlugins = true;
var line1 = [6.75, 14, 10.75, 0, 10];
var line2 = [4.88, 9.63, 7.25, 15.5, 11.75];
2011-08-10 01:10:50 +02:00
var tickers = ['2008-03-01', '2008-04-01', '2008-05-01', '2008-06-01', '2008-07-01'];
var plot1 = $.jqplot('chart1', [line1, line2], {
stackSeries: true,
legend: {
renderer: $.jqplot.EnhancedLegendRenderer,
show: true,
location: 'ne'
},
title: 'Data per month stack by user',
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barWidth: 20
},
pointLabels: {
hideZeros: true
}
},
series: [{
label: 'User1'
},
{
label: 'User2'
}],
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: tickers
},
yaxis: {
min: 0
}
}
});
var line1 = [20, 10];
var line2 = [80, 90];
var plot2 = $.jqplot('chart2', [line1, line2], {
grid:{
drawGridlines:true,
background: '#ffffff',
borderWidth: 0,
shadow: false
},
2011-08-10 01:10:50 +02:00
stackSeries: true,
seriesColors: ["#82BC24","#363636"],
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions:{barMargin: 25},
pointLabels:{stackedValue: true},
yaxis:'y2axis',
shadow: false
2011-08-10 01:10:50 +02:00
},
series:[
{pointLabels:{ypadding: -15}},
{pointLabels:{ypadding:9000}} // this hack will push the labels for the top series off of the page so they don't appear.
2011-08-10 01:10:50 +02:00
],
axes: {
xaxis:{
ticks:[2010, 2040],
renderer:$.jqplot.CategoryAxisRenderer,
tickOptions:{
showGridline:false,
markSize:0
}
},
y2axis:{
ticks:[0, 100],
tickOptions:{formatString:'%d\%'}
}
2011-08-10 01:10:50 +02:00
}
});;
2011-08-10 01:10:50 +02:00
});
</script>
</head>
<body>
<?php include "topbanner.inc"; ?>
<div class="example-content">
<?php include "nav.inc"; ?>
2011-08-10 01:10:50 +02:00
<div id="chart1" class='plot' style="margin-top:20px; margin-left:20px; width:400px; height:300px;"></div>
<div id="chart2" class='plot' style="margin-top:20px; margin-left:20px; width:200px; height:200px;"></div>
</div>
2011-08-10 01:10:50 +02:00
</body>
</html>