Package org.krysalis.jcharts.axisChart

Examples of org.krysalis.jcharts.axisChart.AxisChart


    ChartProperties chartProperties= new ChartProperties();
    AxisProperties axisProperties= new AxisProperties();
    LegendProperties legendProperties= new LegendProperties();

    AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, AxisChartsGuide.width, AxisChartsGuide.height );

    super.exportImage( axisChart, "stackedArea" );

  }
View Full Code Here




    LegendProperties legendProperties = new LegendProperties();

    AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 400 );

    ChartTestDriver.exportImage( axisChart, "BarChartTest.png" );


  }
View Full Code Here

    dataSeries.addIAxisPlotDataSet( AxisChartsGuide.createAxisChartDataSet( ChartType.AREA, new AreaChartProperties(), 200, 5000 ) );

    ChartProperties chartProperties = new ChartProperties();
    LegendProperties legendProperties = new LegendProperties();

    AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, AxisChartsGuide.width, AxisChartsGuide.height );

    return axisChart;
  }
View Full Code Here

    DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title );
    AxisChartDataSet axisChartDataSet = new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, new BarChartProperties() );

    dataSeries.addIAxisPlotDataSet( axisChartDataSet );

    AxisChart axisChart = new AxisChart( dataSeries, new ChartProperties(), axisProperties, new LegendProperties(), width, height );
    super.exportImage( axisChart, "horizontalPlots" );
  }
View Full Code Here

    DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title );
    AxisChartDataSet axisChartDataSet = new AxisChartDataSet( data, legendLabels, paints, ChartType.AREA, new AreaChartProperties() );

    dataSeries.addIAxisPlotDataSet( axisChartDataSet );

    AxisChart axisChart = new AxisChart( dataSeries, new ChartProperties(), axisProperties, new LegendProperties(), width, height );
    super.exportImage( axisChart, "gridLines" );
  }
View Full Code Here


    DataSeries dataSeries = new DataSeries( xAxisLabels, null, yAxisTitle, title );
    dataSeries.addIAxisPlotDataSet( axisChartDataSet );

    AxisChart axisChart = new AxisChart( dataSeries, new ChartProperties(), new AxisProperties(), new LegendProperties(), width, height );
    super.exportImage( axisChart, "axisTitles" );

    AxisProperties axisProperties = new AxisProperties();
    ChartFont yAxisFont = new ChartFont( new Font( "Arial Narrow", Font.BOLD, 14 ), Color.blue );
    axisProperties.getYAxisProperties().setAxisTitleChartFont( yAxisFont );

    axisChart = new AxisChart( dataSeries, new ChartProperties(), axisProperties, new LegendProperties(), width, height );
    super.exportImage( axisChart, "axisTitleFont" );
  }
View Full Code Here

            dataAxisProperties.setRoundToNearest(-1);
            LegendProperties legendProperties = new LegendProperties();
            legendProperties.setPlacement(LegendProperties.RIGHT);
            legendProperties.setNumColumns(1);
           
            AxisChart axisChart = new AxisChart(dataSeries,chartProperties,axisProperties,legendProperties,width,height);
            final ByteCounter byteCounter = new ByteCounter(); byteCounter.bytes = 0;
            PNGEncoder.encode(axisChart,new OutputStream() {
              public void write(int b) throws IOException {
                args.res.print((char)b);
                byteCounter.bytes++;
View Full Code Here

    xAxis.setUserDefinedScale( -300, 200 );
*/

    LegendProperties legendProperties = new LegendProperties();

    AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 400 );

    axisChart.renderWithImageMap();

    ChartTestDriver.exportImage( axisChart, "pointChartTest.png" );
  }
View Full Code Here

  static void axisChartTest( String name, AxisChartTestBase axisChartTestBase ) throws ChartDataException, PropertyException
  {
    LegendProperties legendProperties;
    ChartProperties chartProperties;
    AxisProperties axisProperties;
    AxisChart axisChart;

    int numTestsToRun = 10;
    String fileName;

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

    for( int i = 0; i < numTestsToRun; i++ )
    {
      DataSeries dataSeries= axisChartTestBase.getDataSeries();

      boolean horizontalPlot= true; //( TestDataGenerator.getRandomNumber( 1 ) > 0.5d );
      boolean createImageMap= true; //( TestDataGenerator.getRandomNumber( 1 ) > 0.5d );

      axisProperties = new AxisProperties( horizontalPlot );
      axisProperties.setXAxisLabelsAreVertical( ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ) );

      TestDataGenerator.randomizeAxisProperties( axisProperties );
      //axisProperties.setYAxisNumItems( 6 );

      DataAxisProperties dataAxisProperties;
      LabelAxisProperties labelAxisProperties;

      if( horizontalPlot )
      {
        dataAxisProperties = ( DataAxisProperties ) axisProperties.getXAxisProperties();
        labelAxisProperties = ( LabelAxisProperties ) axisProperties.getYAxisProperties();
      }
      else
      {
        dataAxisProperties = ( DataAxisProperties ) axisProperties.getYAxisProperties();
        labelAxisProperties = ( LabelAxisProperties ) axisProperties.getXAxisProperties();
      }

      dataAxisProperties.setRoundToNearest( 1 );
      //dataAxisProperties.setUserDefinedScale( 10, 500 );
     

      //---if the labels are NULL, force to zero.
      if( dataSeries.getNumberOfAxisLabels() == 0 )
      {
        labelAxisProperties.setShowAxisLabels( false );
      }
      else
      {
        labelAxisProperties.setShowAxisLabels( ( TestDataGenerator.getRandomNumber( 1 ) > 0.3d ) );
      }


      int width = ( int ) TestDataGenerator.getRandomNumber( 500, 1000 );
      int height = ( int ) TestDataGenerator.getRandomNumber( 300, 800 );

      legendProperties = new LegendProperties();
      TestDataGenerator.randomizeLegend( legendProperties );
      //legendProperties.setPlacement( LegendAreaProperties.RIGHT );

      chartProperties = new ChartProperties();
      //chartProperties.setBorderStroke( new BasicStroke( 1f ) );


      axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, width, height );


      fileName = ChartTestDriver.OUTPUT_PATH + name + i + ChartTestDriver.EXTENSION;


      ImageMap imageMap;
      if( createImageMap && axisChartTestBase.supportsImageMap() )
      {
        axisChart.renderWithImageMap();
        imageMap= axisChart.getImageMap();
      }
      else
      {
        imageMap= null;
      }

      try
      {
        ChartTestDriver.exportImage( axisChart, fileName );
      }
      catch( NullPointerException nullPointerException )
      {
        nullPointerException.printStackTrace();
        System.out.println();
      }

      axisChart.toHTML( htmlGenerator, fileName, imageMap );
      htmlGenerator.addLineBreak();
    }

    htmlGenerator.saveFile();
  }
View Full Code Here

    dataAxisProperties.setNumItems( 4 );
    dataAxisProperties.setRoundToNearest( 1 );

    LegendProperties legendProperties= new LegendProperties();

    AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 400 );

    ChartTestDriver.exportImage( axisChart, "AreaChartTest.png" );

  }
View Full Code Here

TOP

Related Classes of org.krysalis.jcharts.axisChart.AxisChart

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.