Example usage for org.jfree.data.xy NormalizedMatrixSeries setScaleFactor

List of usage examples for org.jfree.data.xy NormalizedMatrixSeries setScaleFactor

Introduction

In this page you can find the example usage for org.jfree.data.xy NormalizedMatrixSeries setScaleFactor.

Prototype

public void setScaleFactor(double factor) 

Source Link

Document

Sets the factor that multiplies each item in this series when observed using getItem mehtod.

Usage

From source file:org.jfree.chart.demo.BubblyBubblesDemo2.java

/**
 * Creates a series./*w  w w.j av  a  2s .  c  om*/
 * 
 * @return The series.
 */
private NormalizedMatrixSeries createInitialSeries() {
    final NormalizedMatrixSeries newSeries = new NormalizedMatrixSeries("Sample Grid 1", SIZE, SIZE);

    // seed a few random bubbles
    for (int count = 0; count < SIZE * 3; count++) {
        final int i = (int) (Math.random() * SIZE);
        final int j = (int) (Math.random() * SIZE);

        final double mij = Math.random() * 1;
        newSeries.update(i, j, mij);
    }

    newSeries.setScaleFactor(newSeries.getItemCount());

    return newSeries;
}

From source file:org.jfree.chart.demo.BubblyBubblesDemo.java

/**
 * Creates a series.//  w  w  w  .  j ava2s .c  o m
 * 
 * @return The series.
 */
private NormalizedMatrixSeries createInitialSeries() {
    final NormalizedMatrixSeries newSeries = new NormalizedMatrixSeries("Sample Grid 1", SIZE, SIZE);

    // seed a few random bubbles
    for (int count = 0; count < SIZE; count++) {
        final int i = (int) (Math.random() * SIZE);
        final int j = (int) (Math.random() * SIZE);

        final int mij = (int) (Math.random() * SIZE);
        newSeries.update(i, j, mij);
    }

    newSeries.setScaleFactor(newSeries.getItemCount());

    return newSeries;
}