Package de.progra.charting.model

Examples of de.progra.charting.model.ChartDataModelConstraints


    /** Finally renders the Object in the Graphics object.
     * @param g the Graphics2D object in which to render
     */
    public void renderChart(Graphics2D g) {
        ChartDataModel m = getChartDataModel();
        ChartDataModelConstraints con = m.getChartDataModelConstraints(CoordSystem.FIRST_YAXIS);
       
        if(m.isColumnNumeric())
            return;
       
        RowColorModel rcm = getRowColorModel();
        AffineTransform yaxis1 = getTransform(CoordSystem.FIRST_YAXIS);       
        AffineTransform yaxis2 = getTransform(CoordSystem.SECOND_YAXIS);
       
        int datasetcount = m.getDataSetNumber();
           
        Point2D point1 = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
                                                           con.getMaximumValue().floatValue()),
                                          null);
        Point2D point2 = yaxis1.transform(new Point2D.Float((float)con.getMaximumColumnValue(),
                                                             con.getMaximumValue().floatValue()),
                                          null);
        Point2D value = point1;
       
        int dataunitwidth = (int)((point2.getX() - point1.getX()) / con.getMaximumColumnValue());
        int boxwidth = (int)(dataunitwidth * boxWidth / datasetcount);
        float margin = (float)(dataunitwidth * ((1.0 - boxWidth)/2f));
       
        Point2D pointzero;
        if(con.getMinimumValue().floatValue() > 0)
           pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
                                                         con.getMinimumValue().floatValue()),
                                        null);
        else if(con.getMaximumValue().floatValue() < 0)
           pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
                                                         con.getMaximumValue().floatValue()),
                                        null);
        else
           pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
                                                         0f),
                                        null);
        
        FontRenderContext columnTopfrc = null;
        LineMetrics lm = null;
View Full Code Here


    /** Finally renders the Object in the Graphics object.
     * @param g the Graphics2D object in which to render
     */
    public void renderChart(Graphics2D g) {
        ChartDataModel m = getChartDataModel();
        ChartDataModelConstraints con = m.getChartDataModelConstraints(CoordSystem.FIRST_YAXIS);
       
        System.out.println("** Maximum: "+con.getMaximumValue()+" Minimum: "+con.getMinimumValue());
       
        if(m.isColumnNumeric())
            return;
       
        RowColorModel rcm = getRowColorModel();
        AffineTransform yaxis1 = getTransform(CoordSystem.FIRST_YAXIS);
       
        int datasetcount = m.getDataSetNumber();
       
        int maximumDataSetLength = Integer.MIN_VALUE;
       
        for(int i = 0; i < model.getDataSetNumber(); i++) {
            maximumDataSetLength = Math.max(maximumDataSetLength, model.getDataSetLength(i));
        }
       
        Point2D pointzero;
        if(con.getMinimumValue().floatValue() > 0)
           pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
                                                         con.getMinimumValue().floatValue()),
                                        null);
        else if(con.getMaximumValue().floatValue() < 0)
           pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
                                                         con.getMaximumValue().floatValue()),
                                        null);
        else
           pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
                                                         0f),
                                        null);
       
        Point2D point1 = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
                                                           con.getMaximumValue().floatValue()),
                                          null);
        Point2D point2 = yaxis1.transform(new Point2D.Float((float)con.getMaximumColumnValue(),
                                                             con.getMaximumValue().floatValue()),
                                          null);
        Point2D value = point1;
       
        int dataunitwidth = (int)((point2.getX() - point1.getX()) / con.getMaximumColumnValue());
        int boxwidth = (int)(dataunitwidth * boxWidth);
        float margin = (float)(dataunitwidth * ((1.0 - boxWidth)/2f));
       
        /* We paint the values starting at x-value "0".
         * As we only render BarCharts for ChartDataModels with
View Full Code Here

TOP

Related Classes of de.progra.charting.model.ChartDataModelConstraints

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.