<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 9.3 圖區屬性 ### 9.3.1 概述 JFreeChart類在繪制圖表時,將大部分工作交給了Plot類(圖形繪制結構)或Plot的子類。JFreeChart類的getPlot()方法返回了一個圖表創建的圖區(plot)的引用。 ``` Plot plot = jfreechart.getPlot(); ``` 我們需要將該引用轉化成Plot的一個具體子類。例如: ``` CategoryPlot plot = jfreechart.getCategoryPlot(); ``` 或 ``` XYPlot plot = jfreechart.getXYPlot(); ``` 注意:如果plot不是相應的類,則在轉化的時候,會拋出ClassCastException類型轉制異常。 ### 9.3.2 圖區子類 那么我們如何知道我們圖表使用的Plot是那個子類呢?作為使用JFreeChart的經驗,分清那些圖表使用CategoryPlot和那些圖表使用XYPlot是非常清晰的。如果還懷疑,看一下ChartFactory類的源代碼就會明白每個類型的圖表是如何放在一起的。 ### 9.3.3 設置圖區背景顏色 我們可以使用方法setBackgroundPaint()設置圖區的背景顏色。例如: ``` Plot plot = jfreechart.getPlot(); plot.setBackgroundPaint(Color.white); ``` 我們可使用Paint接口的任何實現作為背景顏色的設置參數,其中有Color、GradientPaint(漸變顏色)和TexturePaint等。同時,我們也可以設置背景顏色為null。 ### 9.3.4 設置背景圖片 我們可以使用方法setBackgroundImage()為圖區設置備有圖片。 ``` Plot plot = jfreechart.getPlot(); plot.setBackgroundImage(JFreeChart.INFO.getLogo()); ``` 默認的,圖片充滿圖表的整個背景,圖片失真。但我們可以改變圖片不充滿整個背景,使用方法是setBackgroundImageAlignment()。 ``` plot.setBackgroundImageAlignment(Align.BOTTOM_RIGHT); ``` 使用setBackgroundImageAlpha()方法,我們可以控制圖片的透明度。如果我們希望圖片充滿這個圖表區域,那么我們需要將背景圖片添加到JFreeChart對象上(前面已經介紹過)。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看