Chart FX for Java Image Borders

Until the advent of the Internet as a viable development platform, desktop applications were developed with strict user interface guidelines. This put constraints on a developer's ability to let components integrate custom interfaces or designs that could jeopardize the application's accessibility.

Nevertheless, the Internet, and more specifically HTML, promoted a new breed of applications. Today, both desktop and browser-based applications must distinguish themselves with original designs and innovative user interfaces. In this regard, Chart FX has pioneered the charting industry by adding features and tools that help developers to integrate extraordinary charts into their desktop applications and web sites with minimal programming effort.

No other charting product provides the graphic pizzazz and innovative tools that Chart FX for Java offers today. Charts now support features like smoothing, transparency, gradients, double-buffering repainting and many others. However, of all the features built into Chart FX for Java geared to enhance the chart's presentation layer, none stand out more than Image Borders.

The Java API alpha blending capability is used to display Chart FX for Java image borders. These borders consist of a series of bitmaps that have transparent or semi-transparent pixels. In addition to a red, green, and blue color channel, each pixel in a border bitmap has a transparency component known as its alpha channel.

The alpha channel lets you control the color of the chart background as well as the color of the HTML page or form while keeping the effect of the border intact, resulting in an outstanding presentation effect for your charts without the restrictions imposed by static bitmaps that can't be changed programmatically.

Image Borders are very simple to integrate and require little or no programming efforts on your part. Also, image borders are supported in a separate assembly that allows you to decide if you want to use and deploy them as part of your application or server.

This section will show you how you can display image borders on your Chart FX for Java applications.

Borders and Background Color

The Chart FX ImageBorders use shading and great edge detail to give a multidimensional effect when they are placed in your forms. When using image borders, you will want them to seamlessly integrate into your page or form design. If you have set the background color of your form to a color other that white, an undesirable white block will be visible around the chart.

The PageColor property can be used to modify the background color of the shaded area around ImageBorders. Setting the PageColor property to match the background color of the webpage will achieve a seamless visual effect.


// Set the page color to blue
chart1.setPageColor(new java.awt.Color(0,255,0));

The following code instantiates a new border object and assigns it to the chart. Please note how the Border Object exposes a variable called Color that can be used to change the border color


ImageBorder myBorder =
new ImageBorder(ImageBorderType.SOLID_LINES);
myBorder.setColor(new java.awt.Color(128, 128, 0));
chart1.setBorderObject(myBorder);

Note: You can also integrate and display image borders from the Chart FX for Java Wizard and Properties List (if supported, through the BorderObject property). The advantage of adding borders using these tools is that you can quickly select among the different supported borders visually, instead of adding the code, compiling and running the application.

Borders and other chart tools

Finally, it is important to mention, Chart FX for Java image borders are prepared to handle additional tools and windows that can be displayed in the chart area, including Toolbar, Legend windows and Data Editor.

The chart displayed uses an Embed image border and notice how the different elements are properly rendered with the same border type.