Discussion:
Have charts to work with a RootPanel based application
yaniv54321
2018-05-06 14:47:55 UTC
Permalink
hello,

i have a GWT app based on RootPanel and not RootLayoutPanel

but it seems that the only way i can use charts (gwt-charts-0.9.10.jar) is
by using RootLayoutPanel

i have tried to find a simple fix by searching the following possible fixes:

1. have an app based on both RootPanel and RootLayoutPanel.
2. have a way to contain RootLayoutPanel inside a RootPanel.
3. have the chart to work in RootPanel without using RootLayoutPanel.

so fur , none of the above works ,

does any one have an idea on how to progress with this
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
David Nouls
2018-05-07 08:18:17 UTC
Permalink
Did you try to put the chart inside a SimpleLayoutPanel ?
Post by yaniv54321
hello,
i have a GWT app based on RootPanel and not RootLayoutPanel
but it seems that the only way i can use charts (gwt-charts-0.9.10.jar) is by using RootLayoutPanel
1. have an app based on both RootPanel and RootLayoutPanel.
2. have a way to contain RootLayoutPanel inside a RootPanel.
3. have the chart to work in RootPanel without using RootLayoutPanel.
so fur , none of the above works ,
does any one have an idea on how to progress with this
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
yaniv54321
2018-05-07 13:28:42 UTC
Permalink
i tried something like this

public class TestFrame extends Composite {

PieChart pieChart ;

public TestFrame() {

VerticalPanel verticalPanel = getPnl();
initWidget( verticalPanel );

Button btn = new Button("graph");
btn.setSize("100%", "100px");
btn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
setViewPieChart();
}});
verticalPanel.add(btn);

}

public static VerticalPanel getPnl(){
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.setWidth("300px");
verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.
ALIGN_LEFT);

return verticalPanel;
}

private void setViewPieChart() {

ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART);
chartLoader.loadApi(new Runnable() {
@Override
public void run() {
SimpleLayoutPanel layoutPanel = new SimpleLayoutPanel();
PieChart pieChart = (PieChart)getPieChart();
layoutPanel.setWidget(getPieChart());
pieChart.draw(getDataTable());

RootPanel.get().clear();
RootPanel.get().add(new TestFrame2(layoutPanel));
}});

}

private Widget getPieChart() {
if (pieChart == null) {
pieChart = new PieChart();
}
return pieChart;
}
}


**********

public class TestFrame2 extends Composite {

public TestFrame2(SimpleLayoutPanel layoutPanel) {

VerticalPanel verticalPanel = getPnl();
initWidget( verticalPanel );

verticalPanel.add(layoutPanel);

}

public static VerticalPanel getPnl(){
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.setWidth("300px");
verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.
ALIGN_LEFT);

return verticalPanel;
}
}
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Loading...