how to create a stacked chart use jasper

How to make a stacked chart

1, prepare data Source

2, import/configuring a data source

(1)    openeclipse Repository Explorer

Window->Show View->Other-> RepositoryExplorer->OK

(2)    DataAdapters -> create Data Adapters  ->CSV file

Name -> char_stacked. (your chart name )

File -> choose your local stacked.csvfile.

Click button -> Get column names fromthe first row of the file

Choose -> Use query executor mode (thereport must use the CSV query language)

Choose -> Skip the first line (thecolumn names will be read from the first line )

Click button -> Finish

3, create a jasper file.

4, make stacked chart.

(1)    Onlykeep Summary, delete Title, Page Header, Column Header, Detail 1, ColumnFooter, Page Footer.

(2)    dragchart from Palette to Summary.

Choose -> Stacked Bar, Next.

(3)    ChartData Configuration.

Series:

5, solutions to some problems:

(1)    Documentis Empty.  

We already configuration the csv data and useit, csv file also have data, but error is document is Empty, this maybe did not configuring the language.

(2)    Cast problem. 

We can changethe data type.

(3)    Unableto get value for CSV field.

This problem, we can check data config again,sometimes our first time configuration has no effect. Need to check again.

Now, click preview, we can see the stacked chart.

How to change bar color?

We can use Chart Plot -> Series Colors. Add the colorwhich we want to change.

How to change Legend position?

How to add a chart title?

Preview




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章