139 lines
6.4 KiB
HTML
139 lines
6.4 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||
|
<!--
|
||
|
/**
|
||
|
* o------------------------------------------------------------------------------o
|
||
|
* | This file is part of the OfficeExcel package - you can learn more at: |
|
||
|
* | |
|
||
|
* | http://www.OfficeExcel.net |
|
||
|
* | |
|
||
|
* | This package is licensed under the OfficeExcel license. For all kinds of business |
|
||
|
* | purposes there is a small one-time licensing fee to pay and for non |
|
||
|
* | commercial purposes it is free to use. You can read the full license here: |
|
||
|
* | |
|
||
|
* | http://www.OfficeExcel.net/LICENSE.txt |
|
||
|
* o------------------------------------------------------------------------------o
|
||
|
*/
|
||
|
-->
|
||
|
<title>Resizing your charts</title>
|
||
|
|
||
|
<meta name="keywords" content="OfficeExcel html5 canvas docs bar charts" />
|
||
|
<meta name="description" content="A description of the resizing feature that's a part of OfficeExcel" />
|
||
|
<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" />
|
||
|
<meta property="og:image" content="http://www.OfficeExcel.net/images/logo.jpg"/>
|
||
|
|
||
|
<link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
|
||
|
<link rel="icon" type="image/png" href="../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.context.js" ></script>
|
||
|
<script src="../libraries/OfficeExcel.common.resizing.js" ></script>
|
||
|
<script src="../libraries/OfficeExcel.common.tooltips.js" ></script>
|
||
|
<script src="../libraries/OfficeExcel.line.js" ></script>
|
||
|
<!--[if lt IE 9]><script src="../excanvas/excanvas.original.js"></script><![endif]-->
|
||
|
|
||
|
<script>
|
||
|
window.onload = function ()
|
||
|
{
|
||
|
/**
|
||
|
* Draw the line chart
|
||
|
*/
|
||
|
var line = new OfficeExcel.Line('myLine', [4,6,3,7,8,4,9,5,6,4,8,5] );
|
||
|
line.Set('chart.labels', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);
|
||
|
line.Set('chart.hmargin', 5);
|
||
|
line.Set('chart.title', 'A resizable line chart (tooltips)');
|
||
|
line.Set('chart.colors', ['red']);
|
||
|
OfficeExcel.isOld() ? null : line.Set('chart.resizable', true);
|
||
|
line.Set('chart.hmargin', 5);
|
||
|
line.Set('chart.shadow', true);
|
||
|
line.Set('chart.shadow.blur', 5);
|
||
|
line.Set('chart.shadow.offsetx', 1);
|
||
|
line.Set('chart.shadow.offsety', 1);
|
||
|
line.Set('chart.background.grid.autofit', true);
|
||
|
line.Set('chart.background.grid.autofit.numhlines', 10);
|
||
|
line.Set('chart.linewidth', 3);
|
||
|
//line.Set('chart.tooltips', ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']);
|
||
|
line.Draw();
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<?php PrintAnalyticsCode() ?>
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
|
||
|
<!-- Social networking buttons -->
|
||
|
<?php
|
||
|
$prefix = substr($_SERVER['SERVER_NAME'], 0, 3);
|
||
|
require("/OfficeExcel.{$prefix}/social.html");
|
||
|
?>
|
||
|
<!-- Social networking buttons -->
|
||
|
|
||
|
<div id="breadcrumb">
|
||
|
<a href="../index.html">OfficeExcel: HTML5 Javascript charts library</a>
|
||
|
>
|
||
|
<a href="./index.html">Documentation</a>
|
||
|
>
|
||
|
Resizing your charts
|
||
|
</div>
|
||
|
|
||
|
<h1>Resizing <span>your 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>
|
||
|
|
||
|
<canvas id="myLine" width="400" height="200" style="float: left">[No canvas support]</canvas>
|
||
|
|
||
|
<p> </p>
|
||
|
|
||
|
<p>
|
||
|
OfficeExcel has the facility to allow you to resize your charts. This is new as of 10th April 2010. Because of the
|
||
|
numerous events it has to install code on, it is unlikely to work with other dynamic features. The context
|
||
|
menu does though, and now that tooltips use DOM2 events, so do they. It can be useful if you are,
|
||
|
for example, doing a presentation and need to enlarge the chart.
|
||
|
</p>
|
||
|
|
||
|
<p>
|
||
|
All you need to do to enable it is set <i>chart.resizable</i> to true. There are certain caveats that you should be aware of though:
|
||
|
</p>
|
||
|
|
||
|
<br clear="all" />
|
||
|
|
||
|
<ul>
|
||
|
<li>
|
||
|
Charts can only be enlarged down and to the right, so you will get better results if your chart is not placed at the
|
||
|
right of the page.
|
||
|
</li>
|
||
|
|
||
|
<li>
|
||
|
The minimum you can resize your charts to is 50% of the original chart width/height.
|
||
|
</li>
|
||
|
|
||
|
<li>
|
||
|
<b>Note:</b> Resizing can change the layout of your page (reflows). As such you will need to be careful when laying out your
|
||
|
page, and you may need to experiment with things like CSS float:, width, height etc so that the effect is either not apparent
|
||
|
or is minimal.
|
||
|
</li>
|
||
|
|
||
|
<li>
|
||
|
If your canvas is nested within a table, resizing can result in very minor (1-2px) positioning changes. These
|
||
|
can be mitigated by turning off table borders, setting the cellspacing to 0 and also setting the cellpadding to 0.
|
||
|
</li>
|
||
|
</ul>
|
||
|
|
||
|
<br /><br /><br />
|
||
|
|
||
|
</body>
|
||
|
</html>
|