亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pieplot.java

?? Web圖形化的Java庫
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
    public void setURLGenerator(PieURLGenerator generator) {
        this.urlGenerator = generator;
    }

    /**
     * Draws the plot on a Java 2D graphics device (such as the screen or a printer).
     *
     * @param g2  the graphics device.
     * @param plotArea  the area within which the plot should be drawn.
     * @param info  collects info about the drawing.
     */
    public void draw(Graphics2D g2, Rectangle2D plotArea, ChartRenderingInfo info) {

        // adjust for insets...
        Insets insets = getInsets();
        if (insets != null) {
            plotArea.setRect(plotArea.getX() + insets.left,
                             plotArea.getY() + insets.top,
                             plotArea.getWidth() - insets.left - insets.right,
                             plotArea.getHeight() - insets.top - insets.bottom);
        }

        if (info != null) {
            info.setPlotArea(plotArea);
            info.setDataArea(plotArea);
        }

        drawBackground(g2, plotArea);
        drawOutline(g2, plotArea);

        Shape savedClip = g2.getClip();
        g2.clip(plotArea);

        Composite originalComposite = g2.getComposite();
        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, getForegroundAlpha()));

        if (this.dataset != null) {
            if (!DatasetUtilities.isEmptyOrNull(this.dataset)) {
                drawPie(g2, plotArea, info, 0, this.dataset, null);
            }
            else {
                drawNoDataMessage(g2, plotArea);
            }
        }
        else {
            drawMultiplePies(g2, plotArea, info);
        }

        g2.clip(savedClip);
        g2.setComposite(originalComposite);

        drawOutline(g2, plotArea);

    }

    /**
     * Draws the pie.
     *
     * @param g2  the graphics device.
     * @param plotArea  the plot area.
     * @param info  chart rendering info.
     * @param pieIndex  the pie index.
     * @param data  the data.
     * @param label  the label.
     */
    protected void drawPie(Graphics2D g2, Rectangle2D plotArea, ChartRenderingInfo info,
                           int pieIndex, PieDataset data, String label) {

        // adjust the plot area by the interior spacing value
        double gapHorizontal = plotArea.getWidth() * this.interiorGap;
        double gapVertical = plotArea.getHeight() * this.interiorGap;
        double pieX = plotArea.getX() + gapHorizontal / 2;
        double pieY = plotArea.getY() + gapVertical / 2;
        double pieW = plotArea.getWidth() - gapHorizontal;
        double pieH = plotArea.getHeight() - gapVertical;

        // make the pie area a square if the pie chart is to be circular...
        if (circular) {
            double min = Math.min(pieW, pieH) / 2;
            pieX = (pieX + pieX + pieW) / 2 - min;
            pieY = (pieY + pieY + pieH) / 2 - min;
            pieW = 2 * min;
            pieH = 2 * min;
        }

        Rectangle2D explodedPieArea = new Rectangle2D.Double(pieX, pieY, pieW, pieH);
        double explodeHorizontal = (1 - radius) * pieW;
        double explodeVertical = (1 - radius) * pieH;
        Rectangle2D pieArea = new Rectangle2D.Double(pieX + explodeHorizontal / 2,
                                                     pieY + explodeVertical / 2,
                                                     pieW - explodeHorizontal,
                                                     pieH - explodeVertical);

        // plot the data (unless the dataset is null)...
        if ((data != null) && (data.getKeys().size() > 0)) {

            // get a list of categories...
            List keys = data.getKeys();

            // compute the total value of the data series skipping over the negative values
            double totalValue = DatasetUtilities.getPieDatasetTotal(data);

            // For each positive value in the dataseries, compute and draw the corresponding arc.
            double runningTotal = 0;
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {

                Comparable currentKey = (Comparable) iterator.next();
                Number dataValue = data.getValue(currentKey);
                if (dataValue != null) {
                    double value = dataValue.doubleValue();
                    if (value > 0) {

                        // draw the pie section...
                        double angle1 = startAngle
                                        + (direction.getFactor() * (runningTotal * 360) 
                                        / totalValue);
                        double angle2 = startAngle
                                        + (direction.getFactor() * (runningTotal + value) * 360 
                                        / totalValue);
                        runningTotal += value;

                        double angle = (angle2 - angle1);
                        if (Math.abs(angle) > this.minimumArcAngleToDraw) {
                            Rectangle2D arcBounds = getArcBounds(pieArea, explodedPieArea,
                                                                 angle1, angle2 - angle1,
                                                                 getExplodePercent(section));
                            Arc2D.Double arc = new Arc2D.Double(arcBounds, angle1, angle2 - angle1,
                                                                Arc2D.PIE);

                            Paint paint = getPaint(section);
                            Paint outlinePaint = getOutlinePaint(section);
                            Stroke outlineStroke = getOutlineStroke(section);

                            g2.setPaint(paint);
                            g2.fill(arc);
                            g2.setStroke(outlineStroke);
                            g2.setPaint(outlinePaint);
                            g2.draw(arc);

                            // add a tooltip for the pie section...
                            if (info != null) {
                                EntityCollection entities = info.getEntityCollection();
                                if (entities != null) {
                                    String tip = null;
                                    if (this.itemLabelGenerator != null) {
                                        tip = this.itemLabelGenerator.generateToolTip(data,
                                            currentKey, pieIndex);
                                    }
                                    String url = null;
                                    if (this.urlGenerator != null) {
                                        url = this.urlGenerator.generateURL(data, currentKey,
                                                                            pieIndex);
                                    }
                                    PieSectionEntity entity = new PieSectionEntity(
                                        arc, dataset, pieIndex, section, currentKey, tip, url
                                    );
                                    entities.addEntity(entity);
                                }
                            }
                        }

                        // then draw the label...
                        if (this.sectionLabelType != NO_LABELS) {
                            drawLabel(g2, pieArea, explodedPieArea, data, value,
                                      section, angle1, angle2 - angle1);
                        }

                    }
                }
                section = section + 1;
            }

            // draw the series label
            if (label != null) {
                g2.setPaint(seriesLabelPaint);
                g2.setFont(seriesLabelFont);

                Rectangle2D bounds = g2.getFontMetrics().getStringBounds(label, g2);
                double labelX = pieX + (pieW / 2) - (bounds.getWidth() / 2);
                double labelY = pieY + pieH + 2 * bounds.getHeight();
                g2.drawString(label, (int) labelX, (int) labelY);
            }
        }
        else {
            drawNoDataMessage(g2, plotArea);
        }
    }

    /**
     * Draws a plot containing multiple pies.
     * 
     * @param g2  the graphics device.
     * @param plotArea  the plot area.
     * @param info  an (optional) carrier for return information about the chart structure.
     */
    protected void drawMultiplePies(Graphics2D g2, Rectangle2D plotArea, ChartRenderingInfo info) {
        
        // check that there is some data to display...
        if (DatasetUtilities.isEmptyOrNull(this.multiDataset)) {
            drawNoDataMessage(g2, plotArea);
            return;
        }
        
        int pieCount = 0;
        if (this.extractType == PER_ROW) {
            pieCount = this.multiDataset.getRowCount();
        }
        else {
            pieCount = this.multiDataset.getColumnCount();
        }

        // the columns variable is always >= rows
        int columns = (int) Math.ceil(Math.sqrt(pieCount));
        int rows = (int) Math.ceil((double) pieCount / (double) columns);

        // swap rows and columns to match plotArea shape
        if (columns > rows && plotArea.getWidth() < plotArea.getHeight()) {
            int temp = columns;
            columns = rows;
            rows = temp;
        }

        int fontHeight = g2.getFontMetrics(seriesLabelFont).getHeight() * 2;
        int x = (int) plotArea.getX();
        int y = (int) plotArea.getY();
        int width = ((int) plotArea.getWidth()) / columns;
        int height = ((int) plotArea.getHeight()) / rows;
        int row = 0;
        int column = 0;
        int diff = (rows * columns) - pieCount;
        int xoffset = 0;
        Rectangle rect = new Rectangle ();

        for (int pieIndex = 0; pieIndex < pieCount; pieIndex++) {
            rect.setBounds(x + xoffset + (width * column),
                           y + (height * row), width, height - fontHeight);

            PieDataset dd = new CategoryToPieDataset(this.multiDataset, this.extractType,
                                                     pieIndex);
            String title = null;
            if (this.extractType == PER_ROW) {
                title = this.multiDataset.getRowKey(pieIndex).toString();
            }
            else {
                title = this.multiDataset.getColumnKey(pieIndex).toString();
            }

            drawPie(g2, rect, info, pieIndex, dd, title);
            ++column;
            if (column == columns) {
                column = 0;
                ++row;

                if (row == rows - 1 && diff != 0) {
                    xoffset = (diff * width) / 2;
                }
            }
        }
    
    }
    
    /**
     * Draws the label for one pie section.
     * <P>
     * You can control the label type using the <code>setSectionLabelType()</code> method.
     *
     * @param g2  the graphics device.
     * @param pieArea  the area for the unexploded pie sections.
     * @param explodedPieArea  the area for the exploded pie section.
     * @param data  the data for the plot.
     * @param value  the value of the label.
     * @param section  the section (zero-based index).
     * @param startAngle  the starting angle.
     * @param extent  the extent of the arc.
     */
    protected void drawLabel(Graphics2D g2,
                             Rectangle2D pieArea, Rectangle2D explodedPieArea,
                             PieDataset data, double value,
                             int section, double startAngle, double extent) {

        // handle label drawing...
        FontRenderContext frc = g2.getFontRenderContext();
        String label = "";
        if (this.sectionLabelType == NAME_LABELS) {
            label = data.getKey(section).toString();
        }
        else if (this.sectionLabelType == VALUE_LABELS) {
            label = valueFormatter.format(value);
        }
        else if (this.sectionLabelType == PERCENT_LABELS) {
            label = percentFormatter.format(extent / 360 * this.direction.getFactor());
        }
        else if (this.sectionLabelType == NAME_AND_VALUE_LABELS) {
            label = data.getKey(section).toString()
                    + " (" + valueFormatter.format(value) + ")";
        }
        else if (this.sectionLabelType == NAME_AND_PERCENT_LABELS) {
            label = data.getKey(section).toString()
                    + " (" + percentFormatter.format(extent / 360 * this.direction.getFactor()) 
                    + ")";
        }
        else if (this.sectionLabelType == VALUE_AND_PERCENT_LABELS) {
            label = valueFormatter.format(value)
                    + " (" + percentFormatter.format(extent / 360 * this.direction.getFactor()) 
                    + ")";
        }
        Rectangle2D labelBounds = this.sectionLabelFont.getStringBounds(label, frc);
        LineMetrics lm = this.sectionLabelFont.getLineMetrics(label, frc);
        double ascent = lm.getAscent();
        Point2D labelLocation = calculateLabelLocation(labelBounds, ascent,
                                                       pieArea, explodedPieArea,
                                                       startAngle, extent,
                                                       getExplodePercent(section));

        Composite saveComposite = g2.getComposite();
        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
        g2.setPaint(this.sectionLabelPaint);
        g2.setFont(this.sectionLabelFont);
        g2.drawString(label, (float) labelLocation.getX(), (float) labelLocation.getY());
        g2.setComposite(saveComposite);

    }

    /**
     * Returns a short string describing the type of plot.
     *
     * @return the plot type.
     */
    public String getPlotType() {
        return localizationResources.getString("Pie_Plot");
    }

    /**
     * A zoom method that does nothing.
     * <p>
     * Plots are required to support the zoom operation.  In the case of a pie
     * chart, it doesn't make sense to zoom in or out, so the method is empty.
     *
     * @param percent  the zoom percentage.
     */
    public void zoom(double percent) {
    }

    /**
     * Returns a rectangle that can be used to create a pie section (taking
     * into account the amount by which the pie section is 'exploded').
     *
     * @param unexploded  the area inside which the unexploded pie sections are drawn.
     * @param exploded  the area inside which the exploded pie sections are drawn.
     * @param startAngle  the start angle.
     * @param extent  the extent of the arc.
     * @param explodePercent  the amount by which the pie section is exploded.
     *
     * @return a rectangle that can be used to create a pie section.
     */
    protected Rectangle2D getArcBounds(Rectangle2D unexploded, Rectangle2D exploded,
                                       double startAngle, double extent, double explodePercent) {

        if (explodePercent == 0.0) {
            return unexploded;
        }
        else {
            Arc2D arc1 = new Arc2D.Double(unexploded, startAngle, extent / 2, Arc2D.OPEN);
            Point2D point1 = arc1.getEndPoint();
            Arc2D.Double arc2 = new Arc2D.Double(exploded, startAngle, extent / 2, Arc2D.OPEN);
            Point2D point2 = arc2.getEndPoint();
            double deltaX = (point1.getX() - point2.getX()) * explodePercent;
            double deltaY = (point1.getY() - point2.getY()) * explodePercent;
            return new Rectangle2D.Double(unexploded.getX() - deltaX,
                                          unexploded.getY() - deltaY,
                                          unexploded.getWidth(),
                                          unexploded.getHeight());

        }
    }

    /**
     * Returns the location for a label, taking into account whether or not the

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区h| 精品国产凹凸成av人网站| 91麻豆精品91久久久久久清纯| 91精品国产综合久久福利软件| 国产精品久久一卡二卡| 日韩福利视频网| 972aa.com艺术欧美| 26uuu亚洲| 日韩1区2区日韩1区2区| 色综合久久久久综合体桃花网| 久久影视一区二区| 日本一不卡视频| 在线视频一区二区三区| 中文字幕永久在线不卡| 国产一区二区在线看| 7777精品伊人久久久大香线蕉的 | 99久久精品一区| 久久视频一区二区| 日韩制服丝袜av| 欧美日韩在线综合| 亚洲另类在线制服丝袜| 成人综合在线观看| 国产亚洲一二三区| 国产风韵犹存在线视精品| 久久―日本道色综合久久| 久久er精品视频| 日韩欧美的一区二区| 欧美aⅴ一区二区三区视频| 欧美日韩一二区| 亚洲国产综合91精品麻豆| 91色.com| 一区二区三区中文在线观看| 99精品在线观看视频| 中文字幕一区二区5566日韩| 大胆亚洲人体视频| 国产三区在线成人av| 国产精品影视天天线| 久久久久久久久久电影| 国产乱妇无码大片在线观看| 久久精品一级爱片| 成人免费观看av| 亚洲欧美视频在线观看| 欧美亚洲综合在线| 午夜精品久久久久久久久久久| 欧美日韩精品一区二区| 日韩国产欧美在线观看| 制服.丝袜.亚洲.中文.综合| 蜜桃av噜噜一区二区三区小说| 欧美一区二区福利在线| 国产精品一级二级三级| 中文字幕国产精品一区二区| 成人av网址在线| 一区二区三区美女视频| 欧美丰满美乳xxx高潮www| 蜜臀精品久久久久久蜜臀| 久久久久久久久岛国免费| 成人精品免费看| 亚洲一区二区三区在线| 日韩三级伦理片妻子的秘密按摩| 精品一区在线看| 中文欧美字幕免费| 欧美色男人天堂| 久久精品国产99久久6| 国产精品人成在线观看免费| 欧美色网一区二区| 国模一区二区三区白浆 | 日韩美女主播在线视频一区二区三区| 九九热在线视频观看这里只有精品| 欧美电影免费观看高清完整版在线观看 | 在线免费观看日韩欧美| 午夜亚洲国产au精品一区二区| 精品久久久久一区二区国产| 99久久精品情趣| 久久精品国产999大香线蕉| 国产精品成人免费在线| 欧美伦理视频网站| 国产v日产∨综合v精品视频| 亚洲国产一区在线观看| 国产亚洲制服色| 欧美日韩免费一区二区三区视频| 国产成人啪免费观看软件| 五月天丁香久久| 中文字幕在线不卡视频| 精品国产露脸精彩对白| 欧美亚洲国产怡红院影院| 国产成人精品三级| 日韩精品色哟哟| 亚洲精品成a人| 中文字幕高清一区| 精品久久人人做人人爽| 欧美日韩亚洲综合一区二区三区| 粉嫩嫩av羞羞动漫久久久| 亚洲超碰精品一区二区| 国产精品久久久久婷婷二区次| 欧美刺激脚交jootjob| 精品视频1区2区| 91网站在线播放| 不卡欧美aaaaa| 国产盗摄视频一区二区三区| 久久成人精品无人区| 亚洲一区二区在线视频| 一区在线观看视频| 亚洲国产成人在线| 2020国产精品自拍| 欧美成人三级电影在线| 日韩一区二区三区免费看 | 成人国产一区二区三区精品| 国产资源在线一区| 精品一区二区三区免费播放| 日韩激情一二三区| 日韩电影一区二区三区四区| 亚洲v日本v欧美v久久精品| 亚洲国产精品久久艾草纯爱| 一区二区在线观看免费| 亚洲免费色视频| 亚洲欧美偷拍另类a∨色屁股| 国产精品久久久久aaaa| 国产精品乱码一区二区三区软件| 国产午夜亚洲精品理论片色戒 | 亚洲小说欧美激情另类| 亚洲精品免费电影| 亚洲成人动漫在线观看| 首页综合国产亚洲丝袜| 丝袜亚洲另类欧美| 青娱乐精品视频| 狠狠网亚洲精品| 国产成人av电影在线| 99精品黄色片免费大全| 欧美综合色免费| 欧美精品第1页| 精品福利一区二区三区免费视频| 精品美女被调教视频大全网站| 欧美成人一区二区三区| 国产日韩精品久久久| 中文字幕日韩精品一区| 亚洲国产一区二区三区 | 国产白丝精品91爽爽久久 | 一区二区三区中文在线| 日韩综合小视频| 国产一区二区视频在线播放| 粉嫩一区二区三区性色av| 色天天综合色天天久久| 欧美日韩国产首页| 久久综合九色综合97_久久久| 国产精品亲子伦对白| 亚洲综合一二三区| 国产在线一区观看| jlzzjlzz欧美大全| 欧美久久高跟鞋激| 久久久久九九视频| 亚洲伊人色欲综合网| 激情五月激情综合网| 一本色道久久综合亚洲aⅴ蜜桃| 欧美日韩一区视频| 精品成人一区二区| 亚洲天天做日日做天天谢日日欢 | 亚洲欧洲精品一区二区精品久久久| 一区二区三区四区激情| 日本视频在线一区| 一本色道久久综合亚洲91 | 亚洲美女偷拍久久| 美女一区二区视频| 色偷偷一区二区三区| 91麻豆精品国产自产在线观看一区| 久久午夜色播影院免费高清| 亚洲国产精品嫩草影院| 成人黄色电影在线| 欧美大片免费久久精品三p| 尤物视频一区二区| 经典三级在线一区| 欧美日韩一级视频| 国产蜜臀97一区二区三区| 热久久国产精品| 97久久精品人人做人人爽50路| 欧美日本一区二区在线观看| 国产精品无遮挡| 精品亚洲porn| 欧美日韩一卡二卡三卡 | 在线一区二区观看| 国产精品免费aⅴ片在线观看| 日韩精品高清不卡| 一本大道久久a久久综合| 久久久久成人黄色影片| 久久国产视频网| 宅男噜噜噜66一区二区66| 亚洲嫩草精品久久| a在线欧美一区| 国产精品免费视频一区| 国产综合久久久久久鬼色| 日韩欧美一级在线播放| 亚洲午夜私人影院| 色婷婷av一区| 亚洲乱码中文字幕综合| 91在线观看免费视频| 中文字幕中文字幕一区二区| 美女一区二区久久| 欧美一区二区三区在线视频| 亚洲成av人片在线| 欧美猛男gaygay网站| 性欧美疯狂xxxxbbbb|