Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to create a sparkChart (RichSparkChart or UISparkChart) in java bean?

user12869467Dec 17 2012 — edited Dec 18 2012
I’m creating a table in my bean. One of the columns needs to be a spark chart. I’m unable to create a spark chart which actually renders a chart. Here is a sample/simplified my code:

{
this.adfColumn = new RichColumn ();

RichSparkChart sparkChart = new RichSparkChart();
sparkChart.setSubType("line");
sparkChart.setNoDataErrorText("no data");

for ( int i = 1; i < 25; i++ )
{
UISparkItem sparkItem = new UISparkItem();
sparkItem.setValue( new Double(i) );
sparkChart.getChildren().add ( sparkItem );
}

this.adfColumn.getChildren().add (sparkChart);
}

What happens is that the column does render, and so does the spark chart but with the “no data” message. It is interesting to point out that if I comment out the for-loop, ie do not add any spark items, then the column renders with a spark chart which I assume is some default/sample of the spark chart (?).

I have also tried setting the sparkItems’s value as a Tree.Entry as that is what our .jsff code does now, with no difference whatsoever.

ANY ideas/advice will be most helpful!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2013
Added on Dec 17 2012
4 comments
285 views