egroupware/phpgwapi/js/jquery/jqplot/examples/stackedBar2.html
Nathan Gray f8489c0ed1 Update jqplot to
jquery.jqplot.1.0.0b2_r947
2011-11-07 20:37:55 +00:00

126 lines
3.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../jquery.jqplot.min.css" />
<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>
<!-- 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>
<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];
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
},
stackSeries: true,
seriesColors: ["#82BC24","#363636"],
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions:{barMargin: 25},
pointLabels:{stackedValue: true},
yaxis:'y2axis',
shadow: false
},
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.
],
axes: {
xaxis:{
ticks:[2010, 2040],
renderer:$.jqplot.CategoryAxisRenderer,
tickOptions:{
showGridline:false,
markSize:0
}
},
y2axis:{
ticks:[0, 100],
tickOptions:{formatString:'%d\%'}
}
}
});;
});
</script>
</head>
<body>
<?php include "topbanner.inc"; ?>
<div class="example-content">
<?php include "nav.inc"; ?>
<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>
</body>
</html>