DocumentServer/OfficeWeb/sdk/Common/Charts/examples/hbar.html
nikolay ivanov a8be6b9e72 init repo
2014-07-05 18:22:49 +00:00

88 lines
3.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>An example of the OfficeExcel Horizontal Bar chart</title>
<meta name="keywords" content="html5 canvas example horizontal bar charts" />
<meta name="description" content="An example of the type of Horizontal Bar chart that OfficeExcel can produce" />
<meta name="googlebot" content="NOODP">
<meta property="og:title" content="OfficeExcel: HTML5 Javascript charts library" />
<meta property="og:description" content="A charts library based on the HTML5 canvas tag" />
<link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
<link rel="icon" type="image/png" href="../images/favicon.png">
<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script src="../libraries/OfficeExcel.common.core.js" ></script>
<script src="../libraries/OfficeExcel.common.tooltips.js" ></script>
<script src="../libraries/OfficeExcel.common.effects.js" ></script>
<script src="../libraries/OfficeExcel.hbar.js" ></script>
<!--[if lt IE 9]><script src="../excanvas/excanvas.original.js"></script><![endif]-->
<script>
/**
* The onload function creates the chart
*/
window.onload = function ()
{
var hbar1 = new OfficeExcel.HBar('hbar1', [55.11, 21.63, 11.94, 7.15, 2.14, 1.11, 0.91]);
var grad = hbar1.context.createLinearGradient(275,0,900, 0);
grad.addColorStop(0, 'white');
grad.addColorStop(1, 'blue');
hbar1.Set('chart.strokestyle', 'rgba(0,0,0,0)');
hbar1.Set('chart.gutter.left', 275);
hbar1.Set('chart.gutter.right', 10);
hbar1.Set('chart.background.grid.autofit', true);
hbar1.Set('chart.title', 'Browser usage (NetApps) in May 2011');
hbar1.Set('chart.labels', ['Microsoft Internet Explorer (55.11%)','Mozilla Firefox (21.63%)', 'Google Chrome (11.94)','Apple Safari (7.15%)','Opera (2.14%)','Opera Mini (1.11)','Other (0.91%)']);
hbar1.Set('chart.shadow', true);
hbar1.Set('chart.shadow.color', 'gray');
hbar1.Set('chart.shadow.offsetx', 0);
hbar1.Set('chart.shadow.offsety', 0);
hbar1.Set('chart.shadow.blur', 15);
hbar1.Set('chart.colors', [grad]);
hbar1.Draw();
}
</script>
<?php PrintAnalyticsCode() ?>
</head>
<body>
<div id="breadcrumb">
<a href="../index.html">OfficeExcel: HTML5 Javascript charts library</a>
>
<a href="./index.html">Examples</a>
>
Horizontal Bar charts example
</div>
<h1>Horizontal <span>bar charts</span></h1>
<script>
if (OfficeExcel.isOld()) {
document.write('<div style="background-color: #fee; border: 2px dashed red; padding: 5px"><b>Important</b><br /><br /> Internet Explorer does not natively support the HTML5 canvas tag, so if you want to see the charts, you can either:<ul><li>Install <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a></li><li>Use ExCanvas. This is provided in the OfficeExcel Archive.</li><li>Use another browser entirely. Your choices are Firefox 3.5+, Chrome 2+, Safari 4+ or Opera 10.5+. </li></ul> <b>Note:</b> Internet Explorer 9 fully supports the canvas tag.</div>');
}
</script>
<p>
A horizontal bar chart can be useful when your labels are too big for regular bar charts.
</p>
<ul>
<li><a href="../docs/hbar.html">Horizontal bar charts API documentation</a></li>
</ul>
<a name="gutter-example"></a>
<canvas id="hbar1" width="900" height="400">[No canvas support]</canvas>
</body>
</html>