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

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

Introduction

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

Prototype

@Override
public void update(int i, int j, double mij) 

Source Link

Document

Updates the value of the specified item in this matrix series.

Usage

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

/**
 * Creates a series.//  ww w .jav  a 2s  . co 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 * 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 ww  .j a  v  a2s.  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;
}