Blog

Adding a Watermark to a Chart

Author:
Date:
September 3, 2013
Category:
Design Approaches

A watermark is text or a logo superimposed on top of a document or image. Sometimes it is necessary to apply a watermark to charts in order to assert ownership of the chart. On the web it can be useful to watermark a URL on a chart so that as it is published in other places such as blogs, traffic is driven to your site.

API_AddingAWatermarkToAChart2

Adding a watermark is easy: you use an image in a note to place the text or graphic on the chart. Since the watermark image is provided via a URL, each time the chart is rendered, the most up-to-date image is used (making it easy to change without coding).

The class used to place the watermark image is NFRegion, with the setImageURL method:

NFRegion watermarkRegion = new NFRegion();
watermarkRegion.setImageURL(“http://www.visualmining.com/images/logo.jpg”);

NFRegion is used in conjunction with NFNote and NFNoteSet. Thus the full code would look like:

API_AddingAWatermarkToAChart

Note that the watermark box automatically sizes to the size of the image. Even if you do not need to use a watermark for its traditional use to assert ownership, this method is a good way to brand your charts.

Comments are closed.