當前位置: 首頁>>代碼示例>>Java>>正文


Java CategoryPlot.getDomainAxisForDataset方法代碼示例

本文整理匯總了Java中org.jfree.chart.plot.CategoryPlot.getDomainAxisForDataset方法的典型用法代碼示例。如果您正苦於以下問題:Java CategoryPlot.getDomainAxisForDataset方法的具體用法?Java CategoryPlot.getDomainAxisForDataset怎麽用?Java CategoryPlot.getDomainAxisForDataset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.plot.CategoryPlot的用法示例。


在下文中一共展示了CategoryPlot.getDomainAxisForDataset方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: calculateBarWidth

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
 * Calculates the bar width and stores it in the renderer state.
 * 
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param rendererIndex  the renderer index.
 * @param state  the renderer state.
 */
protected void calculateBarWidth(CategoryPlot plot, 
                                 Rectangle2D dataArea, 
                                 int rendererIndex,
                                 CategoryItemRendererState state) {

    // calculate the bar width
    CategoryAxis xAxis = plot.getDomainAxisForDataset(rendererIndex);
    CategoryDataset data = plot.getDataset(rendererIndex);
    if (data != null) {
        PlotOrientation orientation = plot.getOrientation();
        double space = 0.0;
        if (orientation == PlotOrientation.HORIZONTAL) {
            space = dataArea.getHeight();
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            space = dataArea.getWidth();
        }
        double maxWidth = space * getMaxBarWidth();
        int columns = data.getColumnCount();
        double categoryMargin = 0.0;
        if (columns > 1) {
            categoryMargin = xAxis.getCategoryMargin();
        }

        double used = space * (1 - xAxis.getLowerMargin() - xAxis.getUpperMargin()
                                 - categoryMargin);
        if (columns > 0) {
            state.setBarWidth(Math.min(used / columns, maxWidth));
        }
        else {
            state.setBarWidth(Math.min(used, maxWidth));
        }
    }

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:44,代碼來源:StackedBarRenderer.java

示例2: calculateBarWidth

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
 * Calculates the bar width and stores it in the renderer state.
 * 
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param rendererIndex  the renderer index.
 * @param state  the renderer state.
 */
protected void calculateBarWidth(CategoryPlot plot, 
                                 Rectangle2D dataArea, 
                                 int rendererIndex,
                                 CategoryItemRendererState state) {

    // calculate the bar width
    CategoryAxis xAxis = plot.getDomainAxisForDataset(rendererIndex);
    CategoryDataset data = plot.getDataset(rendererIndex);
    if (data != null) {
        PlotOrientation orientation = plot.getOrientation();
        double space = 0.0;
        if (orientation == PlotOrientation.HORIZONTAL) {
            space = dataArea.getHeight();
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            space = dataArea.getWidth();
        }
        double maxWidth = space * getMaximumBarWidth();
        int columns = data.getColumnCount();
        double categoryMargin = 0.0;
        if (columns > 1) {
            categoryMargin = xAxis.getCategoryMargin();
        }

        double used = space * (1 - xAxis.getLowerMargin() 
                                 - xAxis.getUpperMargin()
                                 - categoryMargin);
        if (columns > 0) {
            state.setBarWidth(Math.min(used / columns, maxWidth));
        }
        else {
            state.setBarWidth(Math.min(used, maxWidth));
        }
    }

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:45,代碼來源:StackedBarRenderer.java

示例3: calculateBarWidth

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
 * Calculates the bar width and stores it in the renderer state.  We override the method in 
 * the base class to take account of the series-->group mapping.
 * 
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param rendererIndex  the renderer index.
 * @param state  the renderer state.
 */
protected void calculateBarWidth(CategoryPlot plot, 
                                 Rectangle2D dataArea, 
                                 int rendererIndex,
                                 CategoryItemRendererState state) {

    // calculate the bar width
    CategoryAxis xAxis = plot.getDomainAxisForDataset(rendererIndex);
    CategoryDataset data = plot.getDataset(rendererIndex);
    if (data != null) {
        PlotOrientation orientation = plot.getOrientation();
        double space = 0.0;
        if (orientation == PlotOrientation.HORIZONTAL) {
            space = dataArea.getHeight();
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            space = dataArea.getWidth();
        }
        double maxWidth = space * getMaxBarWidth();
        int groups = this.seriesToGroupMap.getGroupCount();
        int categories = data.getColumnCount();
        int columns = groups * categories;
        double categoryMargin = 0.0;
        double itemMargin = 0.0;
        if (categories > 1) {
            categoryMargin = xAxis.getCategoryMargin();
        }
        if (groups > 1) {
            itemMargin = getItemMargin();   
        }

        double used = space * (1 - xAxis.getLowerMargin() - xAxis.getUpperMargin()
                                 - categoryMargin - itemMargin);
        if (columns > 0) {
            state.setBarWidth(Math.min(used / columns, maxWidth));
        }
        else {
            state.setBarWidth(Math.min(used, maxWidth));
        }
    }

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:51,代碼來源:GroupedStackedBarRenderer.java

示例4: calculateBarWidth

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
 * Calculates the bar width and stores it in the renderer state.  We 
 * override the method in the base class to take account of the 
 * series-to-group mapping.
 * 
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param rendererIndex  the renderer index.
 * @param state  the renderer state.
 */
protected void calculateBarWidth(CategoryPlot plot, 
                                 Rectangle2D dataArea, 
                                 int rendererIndex,
                                 CategoryItemRendererState state) {

    // calculate the bar width
    CategoryAxis xAxis = plot.getDomainAxisForDataset(rendererIndex);
    CategoryDataset data = plot.getDataset(rendererIndex);
    if (data != null) {
        PlotOrientation orientation = plot.getOrientation();
        double space = 0.0;
        if (orientation == PlotOrientation.HORIZONTAL) {
            space = dataArea.getHeight();
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            space = dataArea.getWidth();
        }
        double maxWidth = space * getMaximumBarWidth();
        int groups = this.seriesToGroupMap.getGroupCount();
        int categories = data.getColumnCount();
        int columns = groups * categories;
        double categoryMargin = 0.0;
        double itemMargin = 0.0;
        if (categories > 1) {
            categoryMargin = xAxis.getCategoryMargin();
        }
        if (groups > 1) {
            itemMargin = getItemMargin();   
        }

        double used = space * (1 - xAxis.getLowerMargin() 
                                 - xAxis.getUpperMargin()
                                 - categoryMargin - itemMargin);
        if (columns > 0) {
            state.setBarWidth(Math.min(used / columns, maxWidth));
        }
        else {
            state.setBarWidth(Math.min(used, maxWidth));
        }
    }

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:53,代碼來源:GroupedStackedBarRenderer.java


注:本文中的org.jfree.chart.plot.CategoryPlot.getDomainAxisForDataset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。