Changes between Version 2 and Version 3 of IndepthIntroduction

Show
Ignore:
Timestamp:
11/19/08 16:48:29 (5 years ago)
Author:
nicoe (IP: 80.236.231.67)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IndepthIntroduction

    v2 v3  
    4646Note that the type of the data is correctly set eventhough we did not have anything to do. 
    4747 
    48 == Let's create a chart now == 
     48== Everybody loves charts == 
    4949 
     50Now we'd like to make our basic report a bit more colorfull, so let's add a little chart. We are using [http://www.lorenzogil.com/projects/pycha/ PyCha] to generate them from our [source:/examples/pie_chart template]: 
     51 
     52{{{ 
     53        options: 
     54            width: 600 
     55            height: 400 
     56            background: {hide: true} 
     57            legend: {hide: true} 
     58            padding: {bottom: 10, left: 70, right: 10, top: 10} 
     59        chart: 
     60            type: pie 
     61            output_type: png 
     62            dataset: 
     63            {% for line in o.lines %} 
     64              - - ${line.item.name} 
     65                - - [0, $line.amount] 
     66            {% end %} 
     67}}} 
     68 
     69Once again we are using the same syntax as genshi but this time this is a [http://genshi.edgewall.org/wiki/Documentation/text-templates.html TextTemplate]. This file follow the [http://www.yaml.org/ YAML] format thus we can render it into a data structure that will be sent to !PyCha. 
     70 
     71And here is the result: 
     72 
     73[[Image(http://www.openhex.com/static/relatorio_trac/pie.png)]] 
     74 
     75== A (not-so) real example == 
     76 
     77Now that we have everything to start working on our [source:/examples/invoice.odt complicated template], we will go through it one step at a time.