NetCharts® Pro: OptionalChartData.java
(A Helper Application for the DrillDownExample)
The complete source code:
package ncpro.examples.servlet.drilldown;
import java.io.*;
import java.util.*;
import java.awt.Color;
import java.awt.Font;
import java.text.SimpleDateFormat;
import netcharts.pro.common.*;public class OptionalChartData {
public OptionalChartData() {
}public void setOptionalChartData(NFGraph chart) {
// For this example we'll add two NoteSet instances. The first one will
// display the date the image was created. The second will be a copyright
// that will be placed on every image.
NFNote note = new NFNote("Copyright 2002 Acme Widgets", new NFPoint(350, 265));
NFNoteSet set = new NFNoteSet(new NFModalLabel(true, Color.black, new Font("Lucinda Bright", Font.PLAIN, 6)), new NFRegion(), new NFAxisMap(NFAxisMap.PIXEL, NFAxisMap.PIXEL));
NFArrowLine aLine = new NFArrowLine(NFArrowLine.SOLID, 1, Color.black, NFArrowLine.FROMTO);
set.setLine(aLine);
chart.addNote(note, set);SimpleDateFormat formatter = new SimpleDateFormat ("EEE, MMM d, yyyy 'at' H:m");
String dateString = formatter.format(new Date());
note = new NFNote("Created: " + dateString, new NFPoint(350, 255));
set = new NFNoteSet(new NFModalLabel(true, Color.black, new Font("Lucinda Bright", Font.PLAIN, 6)), new NFRegion(), new NFAxisMap(NFAxisMap.PIXEL, NFAxisMap.PIXEL));
aLine = new NFArrowLine(NFArrowLine.SOLID, 1, Color.black, NFArrowLine.FROMTO);
set.setLine(aLine);
chart.addNote(note, set);return;
}
}
![]()



