J2ME Polish
J2ME Polish 2.4 Documentation
Enough Software


Use the ChartItem for visualizing numerical data in different ways.


A ChartItem
The above design has been realized with these CSS settings:

backgrounds {
	chartItemBackground {
		type: round-rect-translucent;
		color: #9fff;

.lineChart {
	background: chartItemBackground;
	padding: 3;
	font-color: gray;
	font-size: small;

ChartItem CSS Attributes

Use following attributes to design ChartItems:


You can choose the visualization mode with the view-type CSS attribute.


Using lines like in the screenshot above is the default visualization mode.


Use bars in your visualization with the chart-vertical-bars view-type:
A ChartItem with vertical bars

.verticalBarChart {
	background: chartItemBackground;
	padding: 3;
	view-type: chart-vertical-bars;
	chart-vertical-bars-shadow-color: gray;


Use a pie diagram in your visualization with the chart-pie view-type:
A ChartItem with a pie visualization

.pieChart {
	background: chartItemBackground;
	padding: 3;
	view-type: chart-pie;


Following sample code illustrates the usage of ChartItems:

// the data that should be visualized:
int[][] dataSequences = new int[][] {
		new int[]{ 12, 0, 5, 20, 25, 40 }, // profits category A
		new int[]{ 0, 2, 4, 8, 16, 32 },   // profits category B
		new int[]{ 1, 42, 7, 12, 16, 1 }   // profits category C
int[] colors = new int[]{ 0xFF0000, 0x00FF00, 0x0000FF }; // colors for each category
//#style .lineChart
ChartItem chart = new ChartItem( "Profits:", dataSequences, colors, style );
chart.setLabelX( "years" );
chart.setLabelY( "profits" );
this.form.append( chart );

Please refer to the "chart" sample application for a complete example.


back to top