KavaChart in Action - Examples and Documentation - ProServe

[ Back ] Basic Charts - Bar & Column Charts

Bar charts are ideal for comparing categories or discrete events against a common scale. In KavaChart, bar charts with vertical bars are called "column" charts, while those with horizontal bars are called "bar" charts.

Bar charts are particularly good at highlighting the differences between items. If you need to show trends, a line chart or area chart variant might be a better choice.

KavaChart ProServe includes these bar chart styles:

  • barApp
  • columnApp
  • stackBarApp
  • stackColumnApp

This page uses chart tags with in-line properties, rather than external style sheets. While this probably isn't an optimal coding style, you can see how we're creating these charts by simply looking at the JSP source code. You can also use the KavaChart ChartWizard to design your own bar charts.
 

This chart definiton illustrates at a glance what the makeup of a youth swim team looks like for several years. In addition to comparing the total size of the team, the chart illustrates the team composition by gender.

A chart like this is a "stacked bar" chart, because the dataset values are stacked, and the bars are horizontal. The chart type is "stackBarApp".

Placing your mouse over a bar in the chart will show what the actual data values are for that item. The format of the numbers is defined using a chart style property.

An image background makes the chart more interesting. Images can be used for any filled chart object: backgrounds, plotareas, even bars. It's usually a good idea to use a muted image to avoid distracting from the chart's data message.

Boys
56 registered swimmers Boys
53 registered swimmers Boys
62 registered swimmers Boys
57 registered swimmers Girls
50 registered swimmers Girls
54 registered swimmers Girls
58 registered swimmers Girls
73 registered swimmers
 

In this sample, we use a baseline value of 0 (the default) to show bars ascending and descending from an expected value. This gives us a side-by-side comparison of 3 different series in 4 different months, and tells us at a glance what the status is for a particular production line.

Y Axis Percentage labels automatically describe the values in a way appropriate for the page viewer. Tooltip labels give exact values for each bar.

Bar baselines can be set at any value. This chart uses "columnApp", vertical bars that are grouped instead of stacked.

A#1728
Value: 1 A#1728
Value: -0.25 A#1728
Value: 0.75 A#1728
Value: 0.63 A#1728
Value: -0.46 A#1729
Value: 0.85 A#1729
Value: 0.45 A#1729
Value: 0.1 A#1729
Value: -0.67 A#1729
Value: 0.1 A#1730
Value: 0.25 A#1730
Value: -0.56 A#1730
Value: -0.9 A#1730
Value: 0.1 A#1730
Value: 0.2
 

Sometimes the simplest chart is best. This bar chart uses "columnApp" with the parameter "individualColors" set to "true". Individual colors make comparisons among bars of a single dataset stand out.

For even more simplicity, we removed the Y axis except for the grid lines, and added a reference line at the goal level. This gives an additional level of information - at a glance you can tell which stores exceeded the sales goal.

Any bar or column chart can have individual colors and any axis can have reference lines.

Since there's not enough room for the labels, the bottom axis automatically staggers them to prevent overlap.

$2,345,000 $3,245,000 $1,754,000 $5,345,000 $2,346,000 $4,352,000
 

Bar/column charts can also be used for scientific work. If you organize your raw data into a histogram, a "columnApp" will display the histogram values correctly. Similarly, a Pareto chart can be created by sorting raw data. See the tag library usage samples for some examples of using built-in data manipulation tags.

You can also add "error bars" to any bar chart by adding Y values to the chart. Here's an example:

Value:2,345
Range:123 Value:3,245
Range:98 Value:1,754
Range:233 Value:5,345
Range:421 Value:2,346
Range:100 Value:4,352
Range:200
 

The last two charts use bars that are partially transparent to provide an interesting visual effect. You can define any color to be partially transparent with ARGB hex numbers. This format looks like this:

aarrggbb

Where the "aa" is a hexadecimal number ranging from 00 (fully transparent) to ff (fully opaque), and "rr" is the red component, ranging from 00 to ff, gg is the green component, and bb is the blue component.

The second chart also uses a type of 3-d layering that looks interesting, but should be used with caution, as it tends to obscure your data.

Y: 132 Y: 323 Y: 542 Y: 321 Y: 432 Y: 123 Y: 434 Y: 456 Y: 132 Y: 323 Y: 542 Y: 321 Y: 432 Y: 123 Y: 434 Y: 456