[Graph.Update:]
Updates a chart in a Word or Powerpoint document with the specified data.
Macro Compatibility
The macro can be used in the highlighted input document types only. A greyed-out icon indicates not supported.
Usage
To update a specific chart, set it's unique ID (any text you like) in Word / Powerpoint in the Alt Text field and use the Id parameter to reference it. Supported chart types are: Area charts (Area, Stacked Area, 100% Stacked Area, 3-D Area, 3-D Stacked Area, 3-D 100% Stacked Area), Bar charts (Clustered Bar, Stacked Bar, 100% Stacked Bar, 3-D Clustered Bar, 3-D Stacked Bar, 3-D 100% Stacked Bar), Column charts (Clustered Column, Stacked Column, 100% Stacked Column, 3-D Clustered Column, 3-D Stacked Column, 3-D 100% Stacked Column, 3-D Column), Combo charts (various combinations of the other supported types MAY work, use with caution), Line charts (Line, Stacked Line, 100% Stacked Line, Line with Markers, Stacked Line with Markers, 100% Stacked Line with Markers, 3-D Line), Pie charts (Pie, 3-D Pie, Doughnut), Radar charts (Radar, Radar with Markers, Filled Radar).
Parameter | Type | Presence | Purpose | Options | Default |
---|---|---|---|---|---|
List<String> | Mandatory | The list of values, in the form: Series Name^Series Name^...;X-axis Label 1;Data^Data^...;X-axis Label 2;Data^Data^...For empty (non-rendered but occupying the right series space) values, simply omit the value but use the delimiter, e.g. X-axis Label 1;Data^^^Data... where the 2nd and 3rd data points are empty. For pie / doughnut charts, the format is: Category Name^Category Value;Category Name^Category Value;Category Name^Category Value... Pie and dougnut charts cannot use empty values (use 0 if you want to show the category in the legend, but with no value). NOTE: for all chart types except pie / doughnut charts, the series names must match the series names of those in the original data, i.e. you cannot change them using this macro (you can use the [Graph.RenameData:] macro to achieve that). For pie and doughnut charts, this macro works differently and simply overwrites the existing data. | N/A | N/A | |
Char | Optional | The delimiter to use between each column in the input values. | N/A | ^ | |
String | Optional | Add a comment to make your document template more readable. The comment is discarded in the output document. | N/A | N/A | |
Boolean | Optional | Should NCalc expression evaluation throw error on Overflow |
|
true | |
String | Optional | The text to display should the macro fail to execute. Note that a poorly-specified macro (e.g. omitting mandatory parameters) will still result in an error message. | N/A | N/A | |
String | Optional | The chart ID, which you can set in it's Alt Text (right-click a chart, then select 'Edit Alt Text'). If you set id=foobar in your macro, the alt text needs to be exactly "foobar" (no quotes). When not set: in Word the previous chart will be used, and in PowerPoint it will find the first 'previous' chart encountered. | N/A | N/A | |
String | Optional | The condition that must be true in order for the macro to be executed/evaluated. Must either evaluate to true or false, for example: "3+5=8" or "contains('abcd', 'z'). | N/A | true | |
MacroMode | Optional | The mode in which variables are stored. In the legacy mode (default for Schedules), the variable created is a string and formatted. In the normal mode (default for Report Studio), the output variable is stored as a strongly-typed object, e.g. an Int32 or a List |
|
Legacy | |
ObfuscationType | Optional | Obfuscation type. Use obfuscation to write reports where sensitive data is hidden. When used, ReportMagic guarantees that the same input string will map to the same output string for the whole of the report (but the next time the report runs, it will most likely map to a different value). If you use obfuscation, the property in your macro will not show up and instead, you will see a fake item of the obfuscation type chosen. |
|
None | |
GraphUpdateType | Optional | The input chart type. Defaults to Bar, but if you use other types, you should set this accordingly. |
|
Bar | |
String | Optional | If specified, adds a warning message for this macro. This is processed as an NCalc, and the warning message will ALWAYS be present and will be the value of the evaluated NCalc expression. | N/A | N/A |
Examples (3)
Example 1:
Update the previous bar chart (as no 'id' parameter is set'):
[Graph.Update: values=Routers^Switches^FWs^LBs;Jan^23^2.4^2^2;Feb^23^2.4^2^2]
Example 2:
Update the bar chart whose ID is 'Chart1'. The chart can be anywhere in the document:
[Graph.Update: id=Chart1, values=Routers^Switches^FWs^LBs;Jan^23^2.4^2^2;Feb^23^2.4^2^2]
Example 3:
Update the previous pie chart:
[Graph.Update: values=Routers^10;Switches^20;FWs^30, type=Pie]