Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Chart Macro In User Macro With Dynamic Content

Pradeep Panayal January 23, 2018

I was trying to use the Chart macro inside user macro by using the following code,

    ## @noparams
    <ac:structured-macro ac:name="chart">
                  <ac:parameter ac:name="type">line</ac:parameter>
                  <ac:parameter ac:name="Tables">Sample</ac:parameter>
    </ac:structured-macro>

    <table id="sample">

                     ... body goes here...

    </table>

I am getting `No Data Available` in my confluence page. How can I provide the dat to a Chart macro dynamically?

1 answer

1 accepted

1 vote
Answer accepted
Andrey Khaneev _StiltSoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 23, 2018

Chart macro is not compatible with dynamic tables, because it is build on the server side.

You can use Chart from Table macro (Table Filter and Charts add-on) instead, this macro is compatible with dynamic tables and charts are generated on the client side.

Pradeep Panayal January 23, 2018

Is it possible to provide the table as part of the Macro declaration?  

Andrey Khaneev _StiltSoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 23, 2018

Yes, you need to place your table inside: 

<ac:structured-macro ac:name="chart">
    <ac:parameter ac:name="type">line</ac:parameter>
    <ac:parameter ac:name="Tables">Sample</ac:parameter>
<ac:rich-text-body>
here goes the table
</ac:rich-text-body>
</ac:structured-macro>
Pradeep Panayal January 24, 2018

Thank you so much Andrey.

Andrey Khaneev _StiltSoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2018

You are welcome!

Stacy Harris January 31, 2019

Can you insert data from other pages into your chart macro?  

Pradeep Panayal March 6, 2019

You can use page include, if you want the full page. Or you can make use of "multiexcerpt" macro to include a section of page.

 

Including this to graph will not work because the page content will be only fetched at the time of rendering.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events