[ofcgwt] StackedBarChart

7 views
Skip to first unread message

Nick

unread,
May 17, 2010, 5:00:13 AM5/17/10
to OFCGWT
Hi all,

I need to know how to add a click event to stack bar charts. I tried
the following code to check whether the Click events are properly
triggered.

ChartWidget chart = new ChartWidget();

ChartData chartData = new ChartData("Satck bar chart", "font-size:
14px; font-family: Verdana; text-align: center;");
chartData.setBackgroundColour("#FFEEEE");

StackedBarChart stackedBarChart = new StackedBarChart();
stackedBarChart.setColours( "#F78181" );

StackedBarChart.StackValue stackValue = new
StackedBarChart.StackValue( 7 );
stackValue.addChartClickHandler( new ChartClickHandler()
{
@Override
public void onClick( ChartClickEvent event )
{
System.out.println("Stacked bar is clicked");
}
});

StackedBarChart.Stack stack = new StackedBarChart.Stack(stackValue);
stackedBarChart.addStack( stack );

chartData.addElements( stackedBarChart );

chart.setChartData(chartData);
RootPanel.get().add( chart );


Although the chart is shown, when I click on the chart, It doesn't
show anything. I tried various ways buy I noticed that the Click event
is not fired.

Can anyone please give a suggestion for "handling click events on a
stacked bar chart" ?

thanks in advance....

--
You received this message because you are subscribed to the Google Groups "OFCGWT" group.
To post to this group, send email to ofc...@googlegroups.com.
To unsubscribe from this group, send email to ofcgwt+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ofcgwt?hl=en.

Reply all
Reply to author
Forward
0 new messages