incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r795154 - /websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo9.html
Date Fri, 02 Sep 2011 08:59:59 GMT
Author: buildbot
Date: Fri Sep  2 08:59:58 2011
New Revision: 795154

Log:
Staging update by buildbot

Modified:
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo9.html

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo9.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo9.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo9.html Fri Sep  2
08:59:58 2011
@@ -78,101 +78,34 @@
   <div id="contenta">
   
     
-    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="stylesheet" href="../images/style.css" type="text/css" />
-<link type="text/css" rel="stylesheet" href="styles/shCoreEclipse.css"/>
-<title>Demos - SimpleODF</title>
-<style type="text/css">
-<!--
-
-.STYLE1 {
-
-color: #FFFFFF;
-
-font-size: 24px;
-
-}
-
-.STYLE2 {font-size: 32px}
-
-.STYLE3 {font-size: 16px}
-
-.STYLE4 {font-size: 36px}
-
--->
-</style>
-<script type="text/javascript" src="scripts/shCore.js"></script>  
-<script type="text/javascript" src="scripts/shBrushJava.js"></script>  
-<script type="text/javascript"> SyntaxHighlighter.all();</script>
-<script type="text/javascript">
-  var _gaq = _gaq || [];
-
-_gaq.push(['_setAccount', 'UA-22366020-1']);
-
-_gaq.push(['_trackPageview']);
-
-(function() {
-
-var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-
-ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-
-var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-
-})();
-
-</script>
-</head>
-<body>
-<div id="page" align="center">
-<div id="content" style="width:920px" class="contentpanel">
-<div id="topheader">
-    <div class="topright"> </div>
-</div>
-<div id="menu">
-<div align="left" class="smallwhitetext"> <a href="../index.html" class="home">
</a> <a href="../downloads.html" class="download"></a> <a href="../documents.html"
class="document"></a> <a href="../demo/index.html" class="sample"> </a>
</div>
-</div>
-<div id="subcontent" align ="left">
-        <div align="left" class="titletext"> <span>
-        <a href="index.html">Simple Demos<a> > 
-        <a href="demo9.html">Demo 8: Create Analysis Report with Charts<a>
-    </span> 
-</div>
-<!---------------------------------------------------------------------------------------------------->

-<div class="contenttitle">
-    <a name="overview">Overview</a>
-</div>
-<div class="bodytext">
-    <p>
-    Simple ODF provides Chart API since version 0.6. Chart is a visualized way of data show
in electronic document. For ODF document, text document, spreadsheet document and presentation
document can embed charts to help describe content. This demo shows the power of chart support
in Simple ODF.<br/><br/>
-    In this demo, a web traffic analytics report will be generated in presentation document
and text document format. The initial data is stored in a spreadsheet document, which includes
visitors, traffic sources and page visit information. These data will be used in charts. Each
chart chooses a cell range and uses the values of these cells to draw picture. It's easy and
convenient.<br/><br/>
-    No need predefined template, all of the document are generated by Simple ODF API. This
demo not only tell you how to use Chart API, but also teach you ro use slide layout to improve
presentation design.<br/><br/>
-    This picture shows the generated presentation document.<br/><br/>
-    <img src="image/demo9p.png"></img><br/><br/>
-    This picture shows the generated text document.<br/><br/>
-    <img src="image/demo9t.png"></img><br/><br/>
-    Besides, we also supply some codes to show how to create chart in a spreadsheet document.
The following picture shows the generated document.<br/><br/> 
-    <img src="image/demo9s.png"></img><br/>
-    </p>
-</div>
-<hr/>
-<div class="contenttitle">
-    <a name="codeintroduction">Code Introduction</a>
-</div>
-<div class="bodytext">
-    <p>
-    There code of this demo is very clear. First, we create a presentation document and load
the data document. Second, we create cover page and set its content. Thirdly, we add charts
to each slide. If you want to add chart to a slide, you must chose a layout which can hold
chart. In Simple ODF 0.6, these layouts are "TITLE_PLUS_CHART", "TITLE_PLUS_2_CHART", "TITLE_LEFT_CHART_RIGHT_OUTLINE",
"TITLE_PLUS_3_OBJECT", "TITLE_PLUS_4_OBJECT". Different layout can own different count of
charts. Please be sure you know that, otherwise chart insert would be failed. For slide, you
needn't set the chart size or position, Simple ODF will do it automatically. Finally, the
data document is closed and the new created document is saved. <br/><br/>
-    <!--java code-->
-    <pre class="brush:java;">
-    private static void generatePresentationChart() {
-        try {
-            PresentationDocument presentationDoc = PresentationDocument.newPresentationDocument();
-            SpreadsheetDocument spreadsheetDoc = SpreadsheetDocument.loadDocument("demo9_data.ods");
+    <p><a href="index.html"><strong>Simple Demos</strong></a>
&gt;  <b>Create Analysis Report with Charts</b><br />
+</p>
+<p><strong>Overview</strong></p>
+<p>Simple ODF provides Chart API since version 0.6. Chart is a visualized way of data
show in electronic document. For ODF document, text document, spreadsheet document and presentation
document can embed charts to help describe content. This demo shows the power of chart support
in Simple ODF.  <br />
+</p>
+<p>In this demo, a web traffic analytics report will be generated in presentation document
and text document format. The initial data is stored in a spreadsheet document, which includes
visitors, traffic sources and page visit information. These data will be used in charts. Each
chart chooses a cell range and uses the values of these cells to draw picture. It's easy and
convenient.  <br />
+</p>
+<p>No need predefined template, all of the document are generated by Simple ODF API.
This demo not only tell you how to use Chart API, but also teach you ro use slide layout to
improve presentation design.<br/><br/>
+This picture shows the generated presentation document.  <br />
+</p>
+<p><img alt="image" src="image/demo9p.png" /> <br />
+This picture shows the generated text document.  <br />
+</p>
+<p><img alt="image" src="image/demo9t.png" /><br />
+</p>
+<p>Besides, we also supply some codes to show how to create chart in a spreadsheet
document. The following picture shows the generated document. <br />
+</p>
+<p><img alt="image" src="image/demo9s.png" /> <br />
+</p>
+<p><strong>Code Introduction</strong></p>
+<p>There code of this demo is very clear. First, we create a presentation document
and load the data document. Second, we create cover page and set its content. Thirdly, we
add charts to each slide. If you want to add chart to a slide, you must chose a layout which
can hold chart. In Simple ODF 0.6, these layouts are "TITLE_PLUS_CHART", "TITLE_PLUS_2_CHART",
"TITLE_LEFT_CHART_RIGHT_OUTLINE", "TITLE_PLUS_3_OBJECT", "TITLE_PLUS_4_OBJECT". Different
layout can own different count of charts. Please be sure you know that, otherwise chart insert
would be failed. For slide, you needn't set the chart size or position, Simple ODF will do
it automatically. Finally, the data document is closed and the new created document is saved.
<br />
+</p>
+<div class="codehilite"><pre><span class="n">private</span> <span
class="n">static</span> <span class="n">void</span> <span class="n">generatePresentationChart</span><span
class="p">()</span> <span class="p">{</span>
+    <span class="n">try</span> <span class="p">{</span>
+        <span class="n">PresentationDocument</span> <span class="n">presentationDoc</span>
<span class="o">=</span> <span class="n">PresentationDocument</span><span
class="o">.</span><span class="n">newPresentationDocument</span><span
class="p">();</span>
+        <span class="n">SpreadsheetDocument</span> <span class="n">spreadsheetDoc</span>
<span class="o">=</span> <span class="n">SpreadsheetDocument</span><span
class="o">.</span><span class="n">loadDocument</span><span class="p">(</span><span
class="s">&quot;demo9_data.ods&quot;</span><span class="p">);</span>
 
-<div class="codehilite"><pre>        <span class="sr">//</span> <span
class="n">create</span> <span class="n">cover</span> <span class="n">page</span>
+        <span class="sr">//</span> <span class="n">create</span>
<span class="n">cover</span> <span class="n">page</span>
         <span class="n">Slide</span> <span class="n">slide</span>
<span class="o">=</span> <span class="n">presentationDoc</span><span
class="o">.</span><span class="n">newSlide</span><span class="p">(</span><span
class="mi">0</span><span class="p">,</span> <span class="s">&quot;Slide1&quot;</span><span
class="p">,</span> <span class="n">SlideLayout</span><span class="o">.</span><span
class="n">TITLE_SUBTITLE</span><span class="p">);</span>
         <span class="n">setSlideTextContent</span><span class="p">(</span><span
class="n">slide</span><span class="p">,</span> <span class="s">&quot;Simple
Website Analytics Report&quot;</span><span class="p">,</span> <span
class="s">&quot;2011-04-27~2011-05-27&quot;</span><span class="p">);</span>
 
@@ -226,20 +159,17 @@ var s = document.getElementsByTagName('s
         <span class="n">e</span><span class="o">.</span><span
class="n">printStackTrace</span><span class="p">();</span>
     <span class="p">}</span>
 <span class="p">}</span>
-<span class="sr">&lt;/pre&gt;</span>
 </pre></div>
 
 
-<p></p>
-<p>
-    The following codes show how to generate the text document format report. Different from
presentation, you need to set chart size before add it to the document.<br/><br/>
-    <!--java code-->
-    <pre class="brush:java;">
-    private static void generateTextDocument() {
-        try {
-            TextDocument textDoc = TextDocument.newTextDocument();
-            SpreadsheetDocument spreadsheetDoc = SpreadsheetDocument.loadDocument("demo9_data.ods");</p>
-<div class="codehilite"><pre>        <span class="sr">//</span> <span
class="n">create</span> <span class="n">cover</span> <span class="n">page</span>
+<p>The following codes show how to generate the text document format report. Different
from presentation, you need to set chart size before add it to the document. <br />
+</p>
+<div class="codehilite"><pre><span class="n">private</span> <span
class="n">static</span> <span class="n">void</span> <span class="n">generateTextDocument</span><span
class="p">()</span> <span class="p">{</span>
+    <span class="n">try</span> <span class="p">{</span>
+        <span class="n">TextDocument</span> <span class="n">textDoc</span>
<span class="o">=</span> <span class="n">TextDocument</span><span
class="o">.</span><span class="n">newTextDocument</span><span class="p">();</span>
+        <span class="n">SpreadsheetDocument</span> <span class="n">spreadsheetDoc</span>
<span class="o">=</span> <span class="n">SpreadsheetDocument</span><span
class="o">.</span><span class="n">loadDocument</span><span class="p">(</span><span
class="s">&quot;demo9_data.ods&quot;</span><span class="p">);</span>
+
+        <span class="sr">//</span> <span class="n">create</span>
<span class="n">cover</span> <span class="n">page</span>
         <span class="n">textDoc</span><span class="o">.</span><span
class="n">addParagraph</span><span class="p">(</span><span class="s">&quot;Simple
Website Analytics Report(2011-04-27~2011-05-27)&quot;</span><span class="p">);</span>
         <span class="n">textDoc</span><span class="o">.</span><span
class="n">addParagraph</span><span class="p">(</span><span class="s">&quot;Visitors
Overview&quot;</span><span class="p">);</span>
         <span class="sr">//</span> <span class="n">create</span>
<span class="n">visitors</span> <span class="n">overview</span> <span
class="n">page</span> <span class="mi">1</span>
@@ -283,53 +213,35 @@ var s = document.getElementsByTagName('s
         <span class="n">e</span><span class="o">.</span><span
class="n">printStackTrace</span><span class="p">();</span>
     <span class="p">}</span>
 <span class="p">}</span>
-<span class="sr">&lt;/pre&gt;</span>
 </pre></div>
 
 
-<p></p>
-<p>
-    Lastly, let's have a look at how to add chart to spreadsheet document. It's similar with
text and presentation documents. On the other hand, it also has a special feature. You can
specify a cell as the position where the chart should be located.<br/><br/>
-    <!--java code-->
-    <pre class="brush:java;">
-    private static void generateSpreadsheetDocument() {
-        try {
-            SpreadsheetDocument spreadsheetDoc = SpreadsheetDocument.loadDocument("demo9_data.ods");
-            // create visitors overview page 1
-            CellRangeAddressList cellRange = CellRangeAddressList.valueOf("A.A1:A.B3");
-            Rectangle rect = new Rectangle();
-            rect.width = 15000;
-            rect.height = 8000;
-            Cell positionCell = spreadsheetDoc.getTableByName("B").getCellByPosition("E1");
-            spreadsheetDoc.createChart("Page Visit", spreadsheetDoc, cellRange, true, true,
false, rect, positionCell);
-            spreadsheetDoc.save("demo9s.ods");
-            spreadsheetDoc.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-    </pre>
-</p>
-</div>
-<hr/>
-<div class="contenttitle">
-    <a name="download">Download</a>
-</div>
-<div class="bodytext">
-  <p>
-    Powered by the Simple Java API for ODF version  <a target="_new" href="../downloads.html"><img
src="../images/link.png"></img>0.6</a>.
-  </p>
-  <p>
-    You can download the code of this demo from <a href="demo9.zip"><img src="../images/link.png"></img>here</a>.
-  </p>
-</div>
-<!---------------------------------------------------------------------------------------------------->
  <br />
-</div>
-<div id="footer" class="smallgraytext"> <a href="#">Home</a> | <a href="#">About
Us</a> | <a href="#">Contact Us</a> </div>
-</div>
-</div>
-</body>
-</html> </p>
+<p>Lastly, let's have a look at how to add chart to spreadsheet document. It's similar
with text and presentation documents. On the other hand, it also has a special feature. You
can specify a cell as the position where the chart should be located.  <br />
+</p>
+<div class="codehilite"><pre><span class="n">private</span> <span
class="n">static</span> <span class="n">void</span> <span class="n">generateSpreadsheetDocument</span><span
class="p">()</span> <span class="p">{</span>
+    <span class="n">try</span> <span class="p">{</span>
+        <span class="n">SpreadsheetDocument</span> <span class="n">spreadsheetDoc</span>
<span class="o">=</span> <span class="n">SpreadsheetDocument</span><span
class="o">.</span><span class="n">loadDocument</span><span class="p">(</span><span
class="s">&quot;demo9_data.ods&quot;</span><span class="p">);</span>
+        <span class="sr">//</span> <span class="n">create</span>
<span class="n">visitors</span> <span class="n">overview</span> <span
class="n">page</span> <span class="mi">1</span>
+        <span class="n">CellRangeAddressList</span> <span class="n">cellRange</span>
<span class="o">=</span> <span class="n">CellRangeAddressList</span><span
class="o">.</span><span class="n">valueOf</span><span class="p">(</span><span
class="s">&quot;A.A1:A.B3&quot;</span><span class="p">);</span>
+        <span class="n">Rectangle</span> <span class="n">rect</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">Rectangle</span><span
class="p">();</span>
+        <span class="n">rect</span><span class="o">.</span><span
class="n">width</span> <span class="o">=</span> <span class="mi">15000</span><span
class="p">;</span>
+        <span class="n">rect</span><span class="o">.</span><span
class="n">height</span> <span class="o">=</span> <span class="mi">8000</span><span
class="p">;</span>
+        <span class="n">Cell</span> <span class="n">positionCell</span>
<span class="o">=</span> <span class="n">spreadsheetDoc</span><span
class="o">.</span><span class="n">getTableByName</span><span class="p">(</span><span
class="s">&quot;B&quot;</span><span class="p">)</span><span
class="o">.</span><span class="n">getCellByPosition</span><span class="p">(</span><span
class="s">&quot;E1&quot;</span><span class="p">);</span>
+        <span class="n">spreadsheetDoc</span><span class="o">.</span><span
class="n">createChart</span><span class="p">(</span><span class="s">&quot;Page
Visit&quot;</span><span class="p">,</span> <span class="n">spreadsheetDoc</span><span
class="p">,</span> <span class="n">cellRange</span><span class="p">,</span>
<span class="n">true</span><span class="p">,</span> <span class="n">true</span><span
class="p">,</span> <span class="n">false</span><span class="p">,</span>
<span class="n">rect</span><span class="p">,</span> <span class="n">positionCell</span><span
class="p">);</span>
+        <span class="n">spreadsheetDoc</span><span class="o">.</span><span
class="n">save</span><span class="p">(</span><span class="s">&quot;demo9s.ods&quot;</span><span
class="p">);</span>
+        <span class="n">spreadsheetDoc</span><span class="o">.</span><span
class="nb">close</span><span class="p">();</span>
+    <span class="p">}</span> <span class="n">catch</span> <span
class="p">(</span><span class="n">Exception</span> <span class="n">e</span><span
class="p">)</span> <span class="p">{</span>
+        <span class="n">e</span><span class="o">.</span><span
class="n">printStackTrace</span><span class="p">();</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p><strong>Download</strong>  <br />
+</p>
+<div class="codehilite"><pre><span class="n">Powered</span> <span
class="n">by</span> <span class="n">the</span> <span class="n">Simple</span>
<span class="n">Java</span> <span class="n">API</span> <span class="k">for</span>
<span class="n">ODF</span> <span class="n">version</span> <span
class="p">[</span><span class="mf">0.6</span><span class="p">][</span><span
class="mi">5</span><span class="p">]</span><span class="o">.</span>
 
+<span class="n">You</span> <span class="n">can</span> <span class="n">download</span>
<span class="n">the</span> <span class="n">code</span> <span class="n">of</span>
<span class="n">this</span> <span class="n">demo</span> <span class="n">from</span>
<span class="p">[</span><span class="n">here</span><span class="p">][</span><span
class="mi">6</span><span class="p">]</span><span class="o">.</span>
+</pre></div>
   </div>
 
   <div id="footera">



Mime
View raw message