Package org.krysalis.jcharts.chartData

Examples of org.krysalis.jcharts.chartData.PieChartDataSet


  private PieChartDataSet getData() throws ChartDataException
  {
    double[] data = new double[]{40, 15, 35, 65, 59};
    Paint[] paints = new Paint[]{Color.blue, Color.red, Color.green, Color.yellow, Color.white};
    String[] labels = {"BMW", "Honda", "Lexus", "Audi", "Acura"};
    return new PieChartDataSet( "Cars That Own!", data, labels, paints, this.properties );
  }
View Full Code Here


    try {
      String[] labels = {"BMW", "Audi", "Lexus"};
      String title = "Cars that Own";
      Paint[] paints = {Color.blue, Color.gray, Color.red};
      double[] data = {50d, 30d, 20d};
        PieChartDataSet pieChartDataSet = new PieChartDataSet( title,
                                           data,
                                           labels,
                                           paints,
                                           this.pieChart2DProperties );
View Full Code Here

   *
   * @throws ChartDataException
   **************************************************************************************/
   public void updateChart() throws ChartDataException
  {
      this.pieChartDataSet = new PieChartDataSet( super.getTitle(),
                                  super.getData()[ 0 ],
                                  super.getLegendLabels(),
                                  super.getPaints(),
                                  this.pieChart2DProperties );

View Full Code Here

    LegendProperties legendProperties = new LegendProperties();
    legendProperties.setPlacement( LegendAreaProperties.RIGHT );
    legendProperties.setNumColumns( 1 );
*/

    PieChartDataSet pieChartDataSet = new PieChartDataSet( "Investment Categories", data, labels, paints, pieChart3DProperties );

    ChartProperties chartProperties = new ChartProperties();
    chartProperties.setBorderStroke( ChartStroke.DEFAULT_CHART_OUTLINE );

    PieChart3D pieChart = new PieChart3D( pieChartDataSet, legendProperties, chartProperties, 500, 400 );
View Full Code Here

  {
    double[] data= { 81d, 55d, 39d, 20.6d };
    String[] labels= { "BMW M5", "BMW M3", "Viper GTS-R", "Corvette Z06" };
    Paint[] paints= { Color.lightGray, Color.green, Color.blue, Color.red };

    PieChartDataSet pieChartDataSet= new PieChartDataSet( "Cars That Own", data, labels, paints, pieChart2DProperties );

    PieChart2D pieChart2D= new PieChart2D( pieChartDataSet, new LegendProperties(), new ChartProperties(), 400, 350 );
    super.exportImage( pieChart2D, name );
  }
View Full Code Here

    double[] data= { 81d, 55d, 39d, 20.6d };
    String[] labels= { "BMW M5", "BMW M3", "Viper GTS-R", "Audi S6" };
    Paint[] paints= { Color.lightGray, Color.green, Color.blue, Color.red };

    PieChartDataSet pieChartDataSet= new PieChartDataSet( "Cars That Own", data, labels, paints, pieChart2DProperties );
    PieChart2D pieChart2D= new PieChart2D( pieChartDataSet, null, new ChartProperties(), 400, 350 );
    super.exportImage( pieChart2D, "pieChartLegendLabels" );
  }
View Full Code Here

  {
    double[] data= { 81d, 55d, 39d, 20.6d };
    String[] labels= { "BMW M5", "BMW M3", "Viper GTS-R", "Corvette Z06" };
    Paint[] paints= { Color.lightGray, Color.green, Color.blue, Color.red };

    PieChartDataSet pieChartDataSet= new PieChartDataSet( "Cars That Own", data, labels, paints, pieChart3DProperties );

    PieChart3D pieChart3D= new PieChart3D( pieChartDataSet, new LegendProperties(), new ChartProperties(), 600, 350 );
    super.exportImage( pieChart3D, name );
  }
View Full Code Here

    double[] data= { 81d, 55d, 39d, 20.6d };
    String[] labels= { "BMW M5", "BMW M3", "Viper GTS-R", "Audi S6" };
    Paint[] paints= { Color.lightGray, Color.green, Color.blue, Color.red };

    PieChartDataSet pieChartDataSet= new PieChartDataSet( "Cars That Own", data, labels, paints, pieChart3DProperties );
    PieChart3D pieChart3D= new PieChart3D( pieChartDataSet, null, new ChartProperties(), 400, 350 );
    super.exportImage( pieChart3D, "pieChart3DLegendLabels" );
  }
View Full Code Here

    String title="Cars that Own";
    Paint[] paints={Color.blue, Color.gray, Color.red};
    double[] data={50d, 30d, 20d};

    PieChart2DProperties pieChart2DProperties=new PieChart2DProperties();
    PieChartDataSet pieChartDataSet=new PieChartDataSet( title, data, labels, paints, pieChart2DProperties );

    PieChart2D pieChart2D=new PieChart2D( pieChartDataSet, new LegendProperties(), new ChartProperties(), 450, 450 );

    //BufferedImage bufferedImage=new BufferedImage( 450, 450, BufferedImage.TYPE_INT_RGB );
    //pieChart2D.setGraphics2D( bufferedImage.createGraphics() );
View Full Code Here

   * @throws ChartDataException
   ******************************************************************************************/
  static void test() throws ChartDataException, PropertyException
  {
    PieChart2D pieChart2D;
    PieChartDataSet pieChartDataSet;
    LegendProperties legendProperties;
    ChartProperties chartProperties;

    int dataSize;
    int width;
    int height;
    int numTestsToRun = 15;
    String fileName;

    HTMLGenerator htmlGenerator = new HTMLGenerator( ChartTestDriver.OUTPUT_PATH + "pieChart2dTest.html" );

    for( int i = 0; i < numTestsToRun; i++ )
    {
      boolean createImageMap = true; //( TestDataGenerator.getRandomNumber( 1 ) > 0.5d );

      dataSize = (int) TestDataGenerator.getRandomNumber( 1, 10 );
      pieChartDataSet = PieTestDriver.getPieChartDataSet( dataSize, 1, 7 );

      width = (int) TestDataGenerator.getRandomNumber( 100, 600 );
      height = (int) TestDataGenerator.getRandomNumber( 100, 600 );

      legendProperties = new LegendProperties();
      TestDataGenerator.randomizeLegend( legendProperties );
      //legendProperties.setBorderStroke( new BasicStroke( 2.0f ) );

      chartProperties = new ChartProperties();
      //areaProperties.setEdgePadding( (int) TestDataGenerator.getRandomNumber( 0, 50 ) );
      chartProperties.setBackgroundPaint( TestDataGenerator.getRandomPaint() );
      //chartProperties.setBorderStroke( new BasicStroke( 1f ) );

      pieChart2D = new PieChart2D( pieChartDataSet, legendProperties, chartProperties, width, height );

      fileName = ChartTestDriver.OUTPUT_PATH + "pieChart2d" + i + ChartTestDriver.EXTENSION;

      ImageMap imageMap;
      if( createImageMap )
      {
        pieChart2D.renderWithImageMap();
        imageMap = pieChart2D.getImageMap();
      }
      else
      {
        imageMap = null;
      }


      ChartTestDriver.exportImage( pieChart2D, fileName );


      htmlGenerator.chartTableStart( "PieChart2D", fileName, imageMap );
      htmlGenerator.propertiesTableRowStart();
      pieChartDataSet.toHTML( htmlGenerator );
      htmlGenerator.propertiesTableRowStart();
      pieChart2D.toHTML( htmlGenerator, fileName );

      htmlGenerator.addLineBreak();
    }
View Full Code Here

TOP

Related Classes of org.krysalis.jcharts.chartData.PieChartDataSet

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.