Invient Charts scaling problem


11682.jpg

I weclome!

At me a question - whether probably - to scale the diagrams placed in affiliated windows, according to the sizes of the window. For example, in drawing the arrangement of elements by default but when I change the size of a window - the diagram is above shown not scaled. How to achieve necessary effect?


11683.jpg

In order to scale InvientCharts, you will need to set width for InvientChart’s container to 100%. Take a look at source code of the demo application.

Thanks

I welcome you, Invient Invient!

Has established width of 100 %, however the diagram isn’t scaled at change of the size of a window -



   .....
      [b]
  VerticalLayout newChartLayout = new VerticalLayout(); 
        newChartLayout.setWidth("100%");
[/b]
        .....		
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.PIE);

        PieConfig pieCfg = new PieConfig();        
        pieCfg.setAllowPointSelect(true);
        pieCfg.setCursor("pointer");
        pieCfg.setDataLabel(new PieDataLabel());
        pieCfg.getDataLabel().setEnabled(true);

        ....
        chartConfig.addSeriesConfig(pieCfg);

        ...
        InvientCharts chart = new InvientCharts(chartConfig);
         ...
      
        HorizontalLayout buttonsBar = new HorizontalLayout();
        ...   
        [b]
newChartLayout.addComponent(chart);
[/b]       
        //newChartLayout.setExpandRatio(chart, 1f); // optional
             newChartLayout.setComponentAlignment(buttonsBar, Alignment.BOTTOM_CENTER);
     ...   
        addComponent(newChartLayout);
	

And why child window resize listener doesn’t work in this case?


public class NewPieChart extends Window...... {
...
public NewPieChart( ... {
...
this.addListener(new Window.ResizeListener()  {
private static final long serialVersionUID = 1L;

public void windowResized(ResizeEvent e)  {
   System.out.println("resize event");
}        	
});
}
}
...

It seems to me, the matter is that a code of diagrams of library InvientCharts, as well as other components Vaadin’s, exists two kinds - server side and client - side.

We manipulate with JS - the widgets generated from client - side, and all user interaction are transferred further on server - side a code.

For windows Vaadin’s are provided, among other, possibilities on scaling - when we pull window edge, the widget sends the asynchronous message on server - side, that generates UIDL for a window of the new size and on it UIDL the widget builds up.

In case of diagrams Invient of such possibility in current release it is not provided.

I.e. online to scale diagrams while it is
impossible
.

However it is possible,
keeping the sizes of elements of the diagram
, at resize an affiliated window to resize and the container, and the diagram always will be on the center and its plane will fill the new appeared areas at increase in the sizes of a window, and accordingly at reduction - will be reduced.

Correct please, if I am not right.

The small amendment.

The matter is that yes - diagrams are really scaled if to consider your recommendation.

However! In IE> = 8 to notice it, it is necessary to update manually page, having pressed F5, or in some other way to initiate inquiry about the server (to open the combobox, to fall outside the limits an outline and so forth)

Whether it is possible - as - that to overcome it?

We will check this issue.

Thanks

Thanks! I will wait! While it is necessary or manually to try to solve a problem, for example, something similar to it -


Timer timer = new Timer(); 
TimerTask task = new TimerTask() {
	 public void run() { 
                    // refresh
	 }
 };    	
 timer.schedule(task, 1000, 1000);

Or to look
ICEPush Add-on

I will be grateful, if to me will help to understand what to do in
this
case.