IBM Support

The IlvBarChartRenderer.widthPercent does not work with single bar charts

Technote (troubleshooting)

This document applies only to the following language version(s):



When setting the widthPercent to an IlvBarChartRenderer with value less than 100, this value is not being honored when there is only one data point (only one bar) in the chart. The bar appears with 100% width of the chart.


By default, the category spacing is only used between bars. The space beyond the leftmost and rightmost bars is being omitted. As a result, in a single bar chart, the bar will be displayed at 100% width regardless of the widthPercent value.

Resolving the problem

To ensure that the spacing beyond the leftmost and rightmost bars are taken into account, IlvBarChartRenderer.setUseCategorySpacingAtBorders must be set to true.

In the doc:

This method "Determines whether the category spacing is used also at the left and right borders. If set to true, category spacing is not only used between bars, but also beyond the leftmost and rightmost bars. If set to false (the default), this spacing is omitted. This setting matters only if getWidthPercent is less than 100. "

This can be done in the CSS file as well, for instance:

  widthPercent : "30.0" ;
  useCategorySpacingAtBorders : "true";

Related information

Documentation for IlvVariableWidthRenderer

Cross reference information
Segment Product Component Platform Version Edition
Business Integration IBM ILOG JViews Charts SDK Platform Independent 8.8, 8.7, 8.6, 8.5 All Editions

Document information

More support for: IBM ILOG JViews Enterprise

Software version: 8.7, 8.8

Operating system(s): Platform Independent

Software edition: All Editions

Reference #: 1621238

Modified date: 20 June 2013