Package org.krysalis.jcharts.chartData

Examples of org.krysalis.jcharts.chartData.PieChartDataSet


    properties.setBorderChartStroke( new ChartStroke( new BasicStroke( 1.0f ), TestDataGenerator.getRandomPaint() ) );

    String[] labels = TestDataGenerator.getRandomStrings( numToCreate, (int) TestDataGenerator.getRandomNumber( 3, 20 ), false );
    Paint[] paints = TestDataGenerator.getRandomPaints( numToCreate );

    return new PieChartDataSet( "This is a test title", TestDataGenerator.getRandomNumbers( numToCreate, minValue, maxValue ), labels, paints, properties );
  }
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 = Pie3DTestDriver.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

    properties.setBorderChartStroke( new ChartStroke( new BasicStroke( 1.0f ), TestDataGenerator.getRandomPaint() ) );

    String[] labels = TestDataGenerator.getRandomStrings( numToCreate, (int) TestDataGenerator.getRandomNumber( 3, 20 ), false );
    Paint[] paints = TestDataGenerator.getRandomPaints( numToCreate );

    return new PieChartDataSet( "This is a test title", TestDataGenerator.getRandomNumbers( numToCreate, minValue, maxValue ), labels, paints, properties );
  }
View Full Code Here

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

    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, 600, 200 );
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

    properties.setBorderChartStroke( new ChartStroke( new BasicStroke( 1.0f ), TestDataGenerator.getRandomPaint() ) );

    String[] labels = TestDataGenerator.getRandomStrings( numToCreate, (int) TestDataGenerator.getRandomNumber( 3, 20 ), false );
    Paint[] paints = TestDataGenerator.getRandomPaints( numToCreate );

    return new PieChartDataSet( "This is a test title", TestDataGenerator.getRandomNumbers( numToCreate, minValue, maxValue ), labels, paints, properties );
  }
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 = Pie3DTestDriver.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

    properties.setBorderChartStroke( new ChartStroke( new BasicStroke( 1.0f ), TestDataGenerator.getRandomPaint() ) );

    String[] labels = TestDataGenerator.getRandomStrings( numToCreate, (int) TestDataGenerator.getRandomNumber( 3, 20 ), false );
    Paint[] paints = TestDataGenerator.getRandomPaints( numToCreate );

    return new PieChartDataSet( "This is a test title", TestDataGenerator.getRandomNumbers( numToCreate, minValue, maxValue ), labels, paints, properties );
  }
View Full Code Here

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

    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, 600, 200 );
View Full Code Here

    public void saveChart(File file) throws IOException, PropertyException, ChartDataException {
        Color[] poleBarev = Arrays.copyOfRange(COLORS, 0, legendLabels.length);
        PieChart2DProperties properties = new PieChart2DProperties();
        if (showChartLabels)
            properties.setPieLabelType(PieLabelType.VALUE_LABELS);
        PieChartDataSet dataset = new PieChartDataSet(title, data, legendLabels, poleBarev, properties);
        LegendProperties legend = new LegendProperties();
        legend.setNumColumns(1);
        ChartProperties chartProperties = new ChartProperties();
        chartProperties.setUseAntiAliasing(true);
        PieChart2D chart = new PieChart2D(dataset, legend, chartProperties, width, height);
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.