How to create a sparkChart (RichSparkChart or UISparkChart) in java bean?
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!!!