Wednesday, 31 July 2013

Customising a charts legend label to reference a page item

I am generating a report (Graph) based on a date field. The requirement is for the legend label to display the data beside the legend label. This leads me on the AnyChart documentation.

First, you need to specify the legend attribute ignore_auto_item to True.

If you don't do this part, whilst the item will be found (below), the format won't be applied, despite matching successfully.

Then, you can define custom formats for each series. In my case, I have two series (Current Report and Previous Report). So, inside the legend node, add the following for each series:

    <item source="Series" series="CURRENT REPORT">
        <format><![CDATA[{%Icon} Current Report - &P22_CURRENT_REPORT.]]></format>
    <item source="Series" series="PREVIOUS REPORT">
        <format><![CDATA[{%Icon} Previous Report - &P22_PREVIOUS_REPORT.]]></format>

The result:


  1. Trent - Not sure if you'll get this - but having an issue. I followed the steps above, but the page item is null. I'm displaying the page items in the same region as the graph, but they are blank. Is there something else that neds to be set?

  2. Where is the "legend node"?