New Features

This section contains information about some of the new advanced features in PopChart Builder. These topics include:

Custom Data Label Formatting

Data Labels can now be customized using macros. For example, in previous versions you only had one option for displaying data labels: the number only. Now, using macros, instead of having a data label that says 43, you can have one that says Price: $43. When combined with showing data labels on rollover, customized data label formatting may virtually eliminate the need for PopUp Text.


Macros are text keywords that stand for a dynamic value, such as a series or category name, or a data value. By using macros, you can make it so that each data label contains information pertinent only to the data item it is associated with.

To customize your data labels, select a graph, right click on it, and select Data Label Properties. The Data Label Format (All Graphs Except Pie) text box lets you change the data label format. A list of available macros is shown below in the Value keywords pull-down menu. You can insert any of these macros into the text box by selecting the macro and clicking in the Insert button.

For example, by default the data label format is simply %_VALUE. This will display only the data value in the data label. If you wanted the data label to display the data series name, followed by a colon, followed by the data value, followed by a dollar sign, you could change the data label format to %_SERIES_NAME: %_VALUE$.

Table 1.1 lists the available data label formatting macros.
Table 1.1 Data Label Macros
Macro Description Graphs
%_BUBBLE_VALUE The value of the bubble in an X-Y or Time Bubble graph. X-Y or Time Bubble
%_CATEGORY_NAME The name of the category that the data item belongs to. All, except X-Y and Time Plot
%_CATEGORY_TOTAL The sum of all data values in the category to which the data item belongs (applies to Area, Bar, Line, Pareto, Pie, Radar
%_CLOSE_VALUE The close value for a high-low data item. Stock
%_GRAPH_TOTAL The sum of all data values in a bar, line, pie, or radar graph. Area, Bar, Line, Pareto, Pie, Radar
%_HIGH_VALUE The high value for a high-low data item. Stock
%_LOW_VALUE The low value for a high-low data item. Stock
%_OPEN_VALUE The open value for a high-low data item. Stock
%_PERCENT_OF_CATEGORY The data value represented as a percentage of the sum of all data values in its category. Area, Bar, Line, Pareto, Pie, Radar
%_PERCENT_OF_TOTAL The data value represented as a percentage of the sum of all data values in the graph. Area, Bar, Line, Pareto, Pie, Radar
%_SERIES_NAME The name of the data series that the data item belongs to. All
%_TIME_VALUE The time value for a Time Plot data item. Time Plot
%_VALUE The value of the data item. Area, Bar, Line, Pareto, Pie, Radar
%_XVALUE The x value for an X-Y data item. X-Y
%_YVALUE The y value for an X-Y or Time Plot data item. X-Y, Time Plot

You can also change the data label format for an individual data series. Simply edit the value in the Data Label Format text box of the Series Properties > Data Labels pane.

For information about dynamically changing the data label format, refer to "Drill-down Effects" in Chapter 7 of the PopChart Server User Guide.

Pareto Data Labels

Data labels on a pareto graph work just like data labels fro any other graph (...). However, since the bars typically indicate a different type of value (e.g. dollars) than the line (percentage), you need to "trick" your appearance file into displaying a different symbol for the data labels along the line.

For example, suppose you set your data label format to $%_VALUE. A data label along the bar would look much like you would expect it to (e.g. $43,000). However, a data label along the line would unfortunately also include the dollar sign. So, wehereas you would want the data label along the line to be labelled as a percentage (e.g. 43%), it would instead use the same data label format as the bar (e.g. $43). This, of course, is probably not what you want to happen.

To work around this problem, first set your global data label string (select Graph Properties > Data Labels in PopChart Builder) to the format that you want data labels along the line to use (e.g. %_VALUE%). Next, use the series data label override (select Series Properties > Data Leabels in PopChart Builder) to change the data label format of the bars (e.g. $%_VALUE). This should give you the correct data label format both for the pareto line and bars.

Global Drill-down Settings and Macros

A graph's global drill-down destination can be set in the Drill-down URL text box of the Graph Properties > Drill-down dialog pane. The global drill-down destination will be applied to any data item that does not have an individual drill-down destination set in either the Series Properties dialog, PopChart XML, or PCScript.

Like data labels, the global drill-down destination can also be customized using macros. In many cases, this may make it so that you no longer have to worry about setting drill-down effects for individual data items.

For example, you could set your global drill-down destination to morestats.jsp?%_SERIES_NAME. If a user clicks on any data item in the Blue series, PopChart Server will drill-down to the address morestats.jsp?Blue.

The Value keywords pull-down menu below the Drill-down URL box lists the available data macros. You can insert any of these macros by selecting the macro and clicking Insert. Table 1.2 lists the available drill-down macros.
Table 1.2 Drill-down Macros
Macro Description Graphs
%_CATEGORY_NAME The name of the category that the data item belongs to. All, except X-Y and Time Plot
%_CATEGORY_NUMBER The number of the data series that the data item belongs to. All, except X-Y and Time Plot
%_POINT_NUMBER The number of the data item in the data series (e.g, the first plot point=1). X-Y and Time Plot
%_SERIES_NAME The name of the data series that the data item belongs to. All
%_SERIES_NUMBER The number of the data series that the data item belongs to. All

For information about dynamically adding or changing drill-down text settings, refer to "Drill-down Effects" in Chapter 7 of the PopChart Server User Guide

PopChart Notes

A new feature in PopChart 4.0.5 is PopChart Notes. Notes are a combination of text boxes and PopUp text (in fact, another name for them is Sticky PopUp). Like PopUp text, they are attached to a specific data item. However, like text boxes they are always visible. Notes "call-out" from the data item—there is a leader line from the data item to the note box.

The image below shows a PopChart image that uses notes. The appearance file for this image is located in chart_root/examples/apfiles/notetest.pcxml.

.

Dynamic PopChart Notes

PopChart Notes can be added dynamically with the graph. AddNote() PCScript method, or the Note attribute of the PopChart XML Data element (refer to "PopChart Notes" in Chapter 7 of the PopChart Server User Guide). You can change the way that dynamic Notes look in the Graph Properties > Notes dialog pane.

Attaching PopChart Notes to Text Boxes

With the graph. AddNote() PCScript, or the NoteTarget attribute of the PopChart XML Data element (refer to "PopChart Notes" in Chapter 7 of the PopChart Server User Guide), you can also attach a note to a text box. When you do this, the text box becomes the PopChart Note. This allows you greater control over the placement of the note. It is also useful when you want several notes that have different formats than dynamically generated notes.

When you attach a Note to a text box, you may want to set the text box so that it will only appear if it is attached to a Note. This way, if you decide not to attach a Note to the text box, the text box will be invisible. To do this, go to the General pane of the Text Box Properties dialog and check the Only Display Textbox as a Note box.

If you are creating text boxes for the sole purpose of using them as PopChart Notes, you may also want to consider creating static PopChart notes, which allow you to better see how the text box would look as a PopChart note, as well as set the Only Display Textbox as a Note option for you.

Using Static PopChart Notes

You can create static PopChart Notes in an appearance file by going to the Series Properties > Note Text dialog pane. Simply enter the text for a PopChart Note next to the data item that you want to attach the note to, then click OK. The Note will appear in the designer.

You can customize this static PopChart Note as if it were a text box. In fact, for all practical purposes, it is a text box. the first notebox will be named notebox1, the second will be named notebox2, and so on.

Static Notes will disappear from a PopChart image if you load new data into the graph. However, they will reappear if you dynamically add a PopChart Note and attach it to the note box.