Package ofc4j.model.elements

Examples of ofc4j.model.elements.PieChart


  protected void createElements() {
    elements.add( getPieChartFromColumn( 0 ) );
  }

  public Element getPieChartFromColumn( int col ) {
    PieChart pc = new PieChart();
    PieChart.Slice[] slices = new PieChart.Slice[getRowCount()];
    for ( int row = 0; row < getRowCount(); row++ ) {
      double d = ( (Number) getValueAt( row, col ) ).doubleValue();
      // Labels are already set - use them
      String label = (String) chart.getXAxis().getLabels().getLabels().get( row );

      slices[row] = new PieChart.Slice( d, label, label );
      if ( tooltipText != null ) {
        slices[row].setTooltip( tooltipText );
      }
    }

    pc.addSlices( slices );
    pc.setColours( colors );
    pc.setStartAngle( startAngle );
    pc.setAnimate( animate );
    if ( alpha != null ) {
      pc.setAlpha( alpha );
    }
    return pc;
  }
View Full Code Here

TOP

Related Classes of ofc4j.model.elements.PieChart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.