Example usage for javafx.scene.chart Chart setPrefSize

List of usage examples for javafx.scene.chart Chart setPrefSize

Introduction

In this page you can find the example usage for javafx.scene.chart Chart setPrefSize.

Prototype

public void setPrefSize(double prefWidth, double prefHeight) 

Source Link

Document

Convenience method for overriding the region's computed preferred width and height.

Usage

From source file:de.ifsr.adam.ImageGenerator.java

/**
 * Calculates the right size of the chart for the given parameters.
 *
 * @param chart//from  w ww.  j  av  a 2  s .c o m
 * @param chartsPerRow
 * @param chartsPerColumn
 */
private void calculateChartSize(Chart chart, Integer chartsPerColumn, Integer chartsPerRow) {
    Double prefHeight, prefWidth;
    prefHeight = (imageHeight / chartsPerColumn) * 0.95;
    prefWidth = (imageWidth / chartsPerRow) * 0.95;
    chart.setPrefSize(prefWidth, prefHeight);
}