JasperReports supports several kinds of charts, such as pie charts, bar charts, XY bar charts, stacked bar charts, line charts, XY line charts, area charts, XY area charts, scatter plot charts, bubble charts, time series charts, high low charts, and candlestick charts. We will discuss each one of these in detail, but before we do so, let's discuss common properties among all charts.
There is a JRXML element used to create each type of chart; all of these elements will be discussed in subsequent sections. Each of these elements must contain a <chart>
element as one of its subelements. The <chart>
element must contain a <reportElement>
element to define the chart's dimensions and position as one of its subelements. It may also contain a <box>
element to draw a border around the chart, a <chartTitle>
subelement to define and format the chart's title, and a <chartSubtitle>
subelement to define and format the chart's subtitle.