[Graph.DeleteData:]
Deletes data (a series or category) from a Microsoft chart in a Word or Powerpoint document.
Macro Compatibility
The macro can be used in the highlighted input document types only. A greyed-out icon indicates not supported.
Parameter | Type | Presence | Purpose | Options | Default |
---|---|---|---|---|---|
List<String> | Mandatory | The category or series name(s) to delete. | N/A | 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 | When set to true (the default), ANY category or series names specified that are not found in the chart will cause a macro error. When set to false, categories and series that do not exist will be ignored and there will be no macro error in the output document. |
|
true | |
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 | |
GraphDataType | Optional | Whether the names specified in the 'names' parameter represent categories or series. |
|
Series | |
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 (4)
Example 1:
This example deletes Series 1 and Series 2 from the previous (because no 'id' parameter is set') bar chart:
[Graph.DeleteData: names=Series 1;Series 2, type=Series]
Example 2:
This example deletes Category 1 and Category 2 from the previous (because no 'id' parameter is set') bar chart:
[Graph.DeleteData: names=Category 1;Category 2, type=Category]
Example 3:
This example deletes Series 1 and Series 2 from the chart whose ID is 'Chart 1'. The chart can be anywhere in the document:
[Graph.DeleteData: id=Chart 1, names=Series 1;Series 2]
Example 4:
This example is similar to the previous examples, except an invalid series name ('Humpty Dumpty') is used - it does not exist in the chart. However, the 'errorIfNotFound' paramter is set to false to ignore this fact rather than generate a Macro Error:
[Graph.DeleteData: id=Chart 1, names=Series 1;Series 2;Humpty Dumpty, errorIfNotFound=false]