0

I am trying to format the legend within Application Express Anychart Flash chart. Here is the relevant XML section:

<legend enabled="true" position="Right" align="Near" elements_layout="Vertical">
<title enabled="true">
<text>Legend</text>
<font family="Tahoma" size="10" color="0x000000" />
</title>
<icon>
<marker enabled="true" />
</icon>
<font family="Tahoma" size="10" color="0x000000" />
</legend>

I am simply trying to add two line items, Sales and Tickets, to describe the lines in my chart with a correctly colored line icons but instead I get two generic entries - Value and Value. Can anyone help me sort out the proper code for this XML?

When I change it to the following:

<legend enabled="true" position="Right" align="Near" elements_layout="Vertical" ignore_auto_item="True">
<title enabled="true">
<text>Legend</text>
<font family="Tahoma" size="10" color="0x000000" />
</title>
<items>
<item>
<text>This is a test</text>
</icon></item>
<item><text>Item 2</text>
</item>
</items>
<icon>
<marker enabled="true" />
</icon>
<font family="Tahoma" size="10" color="0x000000" />
</legend>

This gives me the two series I want but no icon.

Please forgive my ignorance here. I still am not getting the simple legend I want. I am using two series queries, Total_Sales and Total_Tickets:

SELECT NULL Link,
trunc(tix.timestamp) AS label,  
sum(tixp.Price) AS value
FROM LS_tickets tix LEFT OUTER JOIN
     LS_ticket_prices tixP
     ON tixp.series_prefix = tix.ticket_series
WHERE tix.event_id = :P145_event_id
and tix.event_id = tixp.event_id
and tix.voided_flag != 'Y'
GROUP BY trunc(tix.timestamp)
ORDER BY trunc(tix.timestamp) ASC

And

SELECT NULL Link,
trunc(tix.timestamp) AS label,  
sum( tixp.quantity ) AS value
FROM LS_tickets tix LEFT OUTER JOIN
     LS_ticket_prices tixP
     ON tixp.series_prefix = tix.ticket_series
WHERE tix.event_id = :P145_event_id
and tix.event_id = tixp.event_id
and tix.voided_flag != 'Y'
GROUP BY trunc(tix.timestamp)
ORDER BY 1

But I am getting an empty legend whenever i try and add ICON information specific for each label as follows:

<legend enabled="true" position="Right" align="Near" elements_layout="Vertical" ignore_auto_item="True">
<title enabled="true">
<text>Legend</text>
<font family="Tahoma" size="10" color="0x000000" />
</title>
<icon><marker enabled="true" /></icon>
<items>
<item source="Series" series="Total_Sales">
<text>{%Icon} Sales</text>
</item>
<item source="Series" series="Total_Tickets"><text>{%Icon} Tickets</text>
</item>
</items>
<font family="Tahoma" size="10" color="0x000000" />
</legend>

1 Answers1

1

It depends on what data structure you are using. You can specify what data should be shown in legend using these xml settings.

Each automatic item have attributes source which can be "Points" or "Series" and series, that specifies the series name: http://www.anychart.com/products/anychart/docs/users-guide/index.html?legend-text-formatting.html#automatic-items

In case of custom line items you can add your own items with any information: http://www.anychart.com/products/anychart/docs/users-guide/index.html?legend-text-formatting.html#custom-items

Here is a list of all keywords that you can use to format the items values: http://www.anychart.com/products/anychart/docs/users-guide/index.html?legend-text-formatting.html#keywords

it looks like the issue occurs while apex working with the series, all of them are created with the name set to "VALUE. Here is a solution for the similar problem: https://community.oracle.com/message/12637203#12637203

AnyChart Support
  • 3,770
  • 1
  • 10
  • 16
  • I appreciate the hlp but I have been through all that documentation and any attempt I have made to adjust the legend items ends up removing the associated graphic and doesn't change the fact that it is saying VALUE in place of the legend item name. – Halifernus Oct 01 '14 at 02:04
  • sorry, did not notice that you are using apex, so the answer is updated according to this – AnyChart Support Oct 01 '14 at 09:59
  • The last link added here links to a post of mine on the otn forums. Following that thread should help to solve this. I'd like to point out that my assessment there is but true and false. Not aliasing the column in the query will mean the series name will default to VALUE, but aliasing will pass that name as the series name. Which in turn can then be used to link up the legend items. – Tom Oct 01 '14 at 12:47