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.

Example 7.3 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 to a graph. You can change the way that dynamic Notes look in the Graph Properties > Notes dialog pane.

PCScript

To add a note dynamically in PCScript, simply pass the following parameters to an graph. AddNote() method: the category number or name, the series number or name, and the text of the note. So, for example, to add the note Here is the Highest Point to the data item in the first category and the second series, you could use this method call:

graph.addNote(1,2,Here is the Highest Point)

The next example illustrates two points: you can add multiple notes in the same AddNote() call by separating each note by a semi-colon, and you can use the actual name of a category or series to identify a data item. This line of PCScript will add both of the yellow notes that you see in Example 7.3.

graph.addNote(Under-Water Basket Weaving,Attendance,Here is the Highest Point; Rocks-Paper-Scissors,Profit,Here is the Lowest Point)

For graphs that do not have categories (X-Y and Time Plot), you should specify the number of the data item instead of the category. In other words, if the data item is the fifth in a data series, you would specify 5 as the first parameter.

Warning: Do not use the Sort Data feature of X-Y or Time Plot graphs when you use notes—if you do, your Note may be associated with the wrong data item.

PopChart XML

You can also add a note to a data item by setting the Note attribute of the Data element in PopChart XML, as shown below. Adding a note in PopChart XML must be done when you send your data to PopChart Server.

<Data Value="34" Note="Here is the Lowest Point" />

Attaching PopChart Notes to Text Boxes

Another interesting feature of PopChart Notes is that you can attach them to a text box. When you do this, the text box becomes the PopChart Note. This allows you greater control over the placement of a note. It is also useful when you want several notes that have different formats than dynamically generated notes, such as the Note that reads Neither High nor Low in Example 7.3.

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. Or, in PopChart XML, set the IsNoteTextbox attribute of a text box's Properties tag to True.

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 in PopChart Builder, 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. See "Using Static PopChart Notes" in Chapter 1 of the PopChart Builder User Guide.

PCScript

You can attach a note to a textbox in PCScript by setting a parameter in your graph. AddNote() method. This fourth parameter should be the name of the text box associated with the note. For example, if the textbox were named notebox1, we would attach a note to it using the following PCScript command:

graph.AddNote(2,2,Neither High Nor Low,notebox1)

PopChart XML

You can also attach a note to a textbox using the NoteTarget attribute of the PopChart XML Data element. Simply set the value of this attribute to the name of the associated text box.