Properties general

Contents:

  • Properties

  • Colors

All Properties listed below are available in the GUI-Builder at Properties. In addition, these can in principle also be set directly by code. For some of them this is recommended due to their complexity.

Property

ChartWidth

Width of the diagram, in pixels.

chart.setWidth("1000");

ChartHeight

Height of the diagram, in pixels.

chart.setHeight("800");

EnableInteractivity

Whether the chart fires user-based events or responds to user interactions. If false, the chart does not trigger select or other interaction-based events (but it does trigger ready or error events) and does not display hover text or otherwise change in response to user input.

chart.setEnableInteractivity(true);

FontName

The default font for all text in the chart. You can override this using properties for specific chart elements.

chart.setFontName("TimesNeewRoman");

FontSize

The default font size (in pixels) for all text in the chart. You can override this using properties for specific chart elements.

chart.setFontSize(12);

ForcelFrame

Draws the diagram inside an inline frame. (Note that this option is ignored in IE8; all IE8 diagrams are drawn in i-frames).

chart.setForceIFrame(false);

ReverseCategories

If true, the slices are drawn counterclockwise. The default is clockwise.

chart.setReverseCategories(false);

Title

Text to display above the chart.

chart.setTitle("Chart");

TitlePosition

Where to place the chart title relative to the chart area. Supported values:

  • in - Draw the title inside the chart area.

  • out - Draw the title outside the chart area.

  • none - Omit the title.

barChart.setTitlePosition(TextPosition.OUT);

Configuration colors

Properties

Colors

The colors to use for the chart elements. An array of strings, where each element is an HTML color string, for example: "colors:['red','#004411']".

List<String> colors= Arrays.asList("#FFFFFF", "Red", "#F4g6uz");
chart.setColors(colors);

Background

The background color for the main area of the chart. Can be either a simple HTML color ring, for example: "'red'" or "'#00cc00'".

chart.setBackground(Background.Color("red"));
/*
 * Params = Bordercolor, Borderwidth, Backgroundcolor
 */
chart.setBackground(Background.StrokeFill("black", 5, "white"));