Confluence Storage Format Examples for Chart Macro

This page is an extension of the documentation for the Chart Macro. This page contains additional examples for the Chart macro.

Pie chart

Here is a simple example of a pie chart.

Storage format

<ac:structured-macro ac:name="chart">
  <ac:parameter ac:name="title">Fish Sold</ac:parameter>
  <ac:parameter ac:name="type">pie</ac:parameter>
  <ac:rich-text-body>
    <table>
      <tbody>
        <tr>
          <th>
            <p>Fish Type</p>
          </th>
          <th>
            <p>2004</p>
          </th>
          <th>
            <p>2005</p>
          </th>
        </tr>
        <tr>
          <th>
            <p>Herring</p>
          </th>
          <td>
            <p>9,500</p>
          </td>
          <td>
            <p>8,300</p>
          </td>
        </tr>
        <tr>
          <th>
            <p>Salmon</p>
          </th>
          <td>
            <p>2,900</p>
          </td>
          <td>
            <p>4,200</p>
          </td>
        </tr>
        <tr>
          <th>
            <p>Tuna</p>
          </th>
          <td>
            <p>1,500</p>
          </td>
          <td>
            <p>1,500</p>
          </td>
        </tr>
      </tbody>
    </table>
  </ac:rich-text-body>
</ac:structured-macro>

Resulting chart

Bar chart

Here is a simple example of a bar chart.

Storage format

<ac:macro ac:name="chart">
  <ac:parameter ac:name="title">Fish Sold</ac:parameter>
  <ac:parameter ac:name="type">bar</ac:parameter>
  <ac:rich-text-body>
    <table>
      <tbody>
        <tr>
          <th>
            <p>Fish Type</p>
          </th>
          <th>
            <p>2004</p>
          </th>
          <th>
            <p>2005</p>
          </th>
        </tr>
        <tr>
          <th>
            <p>Herring</p>
          </th>
          <td>
            <p>9,500</p>
          </td>
          <td>
            <p>8,300</p>
          </td>
        </tr>
        <tr>
          <th>
            <p>Salmon</p>
          </th>
          <td>
            <p>2,900</p>
          </td>
          <td>
            <p>4,200</p>
          </td>
        </tr>
        <tr>
          <th>
            <p>Tuna</p>
          </th>
          <td>
            <p>1,500</p>
          </td>
          <td>
            <p>1,500</p>
          </td>
        </tr>
      </tbody>
    </table>
  </ac:rich-text-body>
</ac:macro>

Resulting chart

Time series chart

Here is an example of a time series chart.

Storage format

<ac:structured-macro ac:name="chart">
  <ac:parameter ac:name="timePeriod">Month</ac:parameter>
  <ac:parameter ac:name="dataOrientation">vertical</ac:parameter>
  <ac:parameter ac:name="rangeAxisLowerBound">0</ac:parameter>
  <ac:parameter ac:name="dateFormat">MM/yyyy</ac:parameter>
  <ac:parameter ac:name="type">timeSeries</ac:parameter>
  <ac:parameter ac:name="domainaxisrotateticklabel">true</ac:parameter>
  <ac:rich-text-body>
    <table>
      <tbody>
        <tr>
          <th>
            <p>Month</p>
          </th>
          <th>
            <p>Revenue</p>
          </th>
        </tr>
        <tr>
          <td>
            <p>1/2005</p>
          </td>
          <td>
            <p>31.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>2/2005</p>
          </td>
          <td>
            <p>41.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>3/2005</p>
          </td>
          <td>
            <p>51.3</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>4/2005</p>
          </td>
          <td>
            <p>33.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>5/2005</p>
          </td>
          <td>
            <p>27.6</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>6/2005</p>
          </td>
          <td>
            <p>49.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>7/2005</p>
          </td>
          <td>
            <p>51.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>8/2005</p>
          </td>
          <td>
            <p>77.3</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>9/2005</p>
          </td>
          <td>
            <p>73.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>10/2005</p>
          </td>
          <td>
            <p>97.6</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>11/2005</p>
          </td>
          <td>
            <p>101.2</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>12/2005</p>
          </td>
          <td>
            <p>113.7</p>
          </td>
        </tr>
      </tbody>
    </table>
    <table>
      <tbody>
        <tr>
          <th>
            <p>Month</p>
          </th>
          <th>
            <p>Expenses</p>
          </th>
        </tr>
        <tr>
          <td>
            <p>1/2005</p>
          </td>
          <td>
            <p>41.1</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>2/2005</p>
          </td>
          <td>
            <p>43.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>3/2005</p>
          </td>
          <td>
            <p>45.3</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>4/2005</p>
          </td>
          <td>
            <p>45.0</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>5/2005</p>
          </td>
          <td>
            <p>44.6</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>6/2005</p>
          </td>
          <td>
            <p>43.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>7/2005</p>
          </td>
          <td>
            <p>51.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>8/2005</p>
          </td>
          <td>
            <p>52.3</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>9/2005</p>
          </td>
          <td>
            <p>53.8</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>10/2005</p>
          </td>
          <td>
            <p>55.6</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>11/2005</p>
          </td>
          <td>
            <p>61.2</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>12/2005</p>
          </td>
          <td>
            <p>63.7</p>
          </td>
        </tr>
      </tbody>
    </table>
  </ac:rich-text-body>
</ac:structured-macro>

Resulting chart

XY line chart

Here is an example of an XY line chart.

Storage format

<ac:macro ac:name="chart">
  <ac:parameter ac:name="type">xyline</ac:parameter>
  <ac:rich-text-body>
    <table>
      <tbody>
        <tr>
          <th>
            <p>&nbsp;</p>
          </th>
          <th>
            <p>12</p>
          </th>
          <th>
            <p>14</p>
          </th>
          <th>
            <p>23</p>
          </th>
        </tr>
        <tr>
          <td>
            <p>Revenue</p>
          </td>
          <td>
            <p>41.1</p>
          </td>
          <td>
            <p>31.8</p>
          </td>
          <td>
            <p>12.4</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>Expense</p>
          </td>
          <td>
            <p>31.1</p>
          </td>
          <td>
            <p>41.8</p>
          </td>
          <td>
            <p>43.6</p>
          </td>
        </tr>
      </tbody>
    </table>
  </ac:rich-text-body>
</ac:macro>

Resulting chart

XY bar chart

Here is an example of an XY bar chart.

Storage format

<ac:structured-macro ac:name="chart">
  <ac:parameter ac:name="opacity">60</ac:parameter>
  <ac:parameter ac:name="type">xybar</ac:parameter>
  <ac:rich-text-body>
    <table>
      <tbody>
        <tr>
          <th>
            <p> </p>
          </th>
          <th>
            <p>2005</p>
          </th>
          <th>
            <p>2006</p>
          </th>
          <th>
            <p>2007</p>
          </th>
        </tr>
        <tr>
          <td>
            <p>Revenue</p>
          </td>
          <td>
            <p>41.1</p>
          </td>
          <td>
            <p>31.8</p>
          </td>
          <td>
            <p>12.4</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>Expense</p>
          </td>
          <td>
            <p>31.1</p>
          </td>
          <td>
            <p>41.8</p>
          </td>
          <td>
            <p>43.6</p>
          </td>
        </tr>
      </tbody>
    </table>
  </ac:rich-text-body>
</ac:structured-macro>

Resulting chart

XY area chart

Here is an example of an XY area chart.

Storage format

<ac:structured-macro ac:name="chart">
  <ac:parameter ac:name="type">xyarea</ac:parameter>
  <ac:rich-text-body>
    <table>
      <tbody>
        <tr>
          <th>
            <p> </p>
          </th>
          <th>
            <p>12</p>
          </th>
          <th>
            <p>14</p>
          </th>
          <th>
            <p>23</p>
          </th>
        </tr>
        <tr>
          <td>
            <p>Revenue</p>
          </td>
          <td>
            <p>41.1</p>
          </td>
          <td>
            <p>31.8</p>
          </td>
          <td>
            <p>12.4</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>Expense</p>
          </td>
          <td>
            <p>31.1</p>
          </td>
          <td>
            <p>41.8</p>
          </td>
          <td>
            <p>43.6</p>
          </td>
        </tr>
      </tbody>
    </table>
  </ac:rich-text-body>
</ac:structured-macro>

Resulting chart

Area chart

Here are two examples of area charts.

Storage format for area chart 1

<ac:structured-macro ac:name="chart">
  <ac:parameter ac:name="height">300</ac:parameter>
  <ac:parameter ac:name="legend">true</ac:parameter>
  <ac:parameter ac:name="width">300</ac:parameter>
  <ac:parameter ac:name="opacity">50</ac:parameter>
  <ac:parameter ac:name="type">area</ac:parameter>
  <ac:parameter ac:name="dataDisplay">true</ac:parameter>
  <ac:rich-text-body>
    <table>
      <tbody>
        <tr>
          <th>
            <p>Satisfaction</p>
          </th>
          <th>
            <p>2002</p>
          </th>
          <th>
            <p>2003</p>
          </th>
          <th>
            <p>2004</p>
          </th>
        </tr>
        <tr>
          <td>
            <p>Very satisfied</p>
          </td>
          <td>
            <p>20</p>
          </td>
          <td>
            <p>23</p>
          </td>
          <td>
            <p>34</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>Satisfied</p>
          </td>
          <td>
            <p>40</p>
          </td>
          <td>
            <p>34</p>
          </td>
          <td>
            <p>23</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>Disatisfied</p>
          </td>
          <td>
            <p>25</p>
          </td>
          <td>
            <p>26</p>
          </td>
          <td>
            <p>25</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>Very disatisfied</p>
          </td>
          <td>
            <p>15</p>
          </td>
          <td>
            <p>17</p>
          </td>
          <td>
            <p>18</p>
          </td>
        </tr>
      </tbody>
    </table>
  </ac:rich-text-body>
</ac:structured-macro>

Resulting area chart 1


Satisfaction

2002

2003

2004

Very satisfied

20

23

34

Satisfied

40

34

23

Disatisfied

25

26

25

Very disatisfied

15

17

18

Storage format for area chart 2

<ac:structured-macro ac:name="chart">
  <ac:parameter ac:name="stacked">true</ac:parameter>
  <ac:parameter ac:name="height">300</ac:parameter>
  <ac:parameter ac:name="legend">true</ac:parameter>
  <ac:parameter ac:name="width">300</ac:parameter>
  <ac:parameter ac:name="type">area</ac:parameter>
  <ac:parameter ac:name="dataDisplay">true</ac:parameter>
  <ac:rich-text-body>
    <table>
      <tbody>
        <tr>
          <th>
            <p>Satisfaction</p>
          </th>
          <th>
            <p>2002</p>
          </th>
          <th>
            <p>2003</p>
          </th>
          <th>
            <p>2004</p>
          </th>
        </tr>
        <tr>
          <td>
            <p>Very satisfied</p>
          </td>
          <td>
            <p>12</p>
          </td>
          <td>
            <p>23</p>
          </td>
          <td>
            <p>31</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>Satisfied</p>
          </td>
          <td>
            <p>1</p>
          </td>
          <td>
            <p>34</p>
          </td>
          <td>
            <p>36</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>Disatisfied</p>
          </td>
          <td>
            <p>4</p>
          </td>
          <td>
            <p>6</p>
          </td>
          <td>
            <p>22</p>
          </td>
        </tr>
        <tr>
          <td>
            <p>Very disatisfied</p>
          </td>
          <td>
            <p>2</p>
          </td>
          <td>
            <p>7</p>
          </td>
          <td>
            <p>12</p>
          </td>
        </tr>
      </tbody>
    </table>
  </ac:rich-text-body>
</ac:structured-macro>

Resulting area chart 2


Satisfaction

2002

2003

2004

Very satisfied

12

23

31

Satisfied

1

34

36

Disatisfied

4

6

22

Very disatisfied

2

7

12

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport