行ごとに色が変わる横棒グラフ

  • 作成者:ayuan0625
  • 編集回数:4次
  • 最終更新:FRInternational 于 2021-01-07
  • I. Overview

    1. Problem description

    When the bar chart has only one series, the chart has only one color, which is monotonous, as shown in the figure below:

    How to set the color change of interlacing for the bar chart, as shown in the figure below:



    2. Solution

    It is realized by chart special effect - condition display.


    II. Examples

    1. Design report

    1) Create a new normal report, create a new data query ds1, and the SQL statement is: select * from Sales_Basic

    2) Merge cells A1 ~ D18 and insert a bar chart, as shown in the following figure:


    3) Bind bar chart data, as shown in the figure below:


    4) In the chart properties panel special effects > condition display, add a color matching condition attribute. When the classification number is included in the formula range (2,100,2), the color matching is green, as shown in the following figure:

    2021-01-07_09-56-27.png

    Note: range (2,100,2) will produce numbers from 2, 4, 6, 8... to 100, that is, when the classification number is even, the color will be green.


    2. Effect preview

    Save the report and click pagination preview. The effect is as follows:

    截屏2021-01-07 上午9.51.41.png


    III. Template download

    Completed template, please refer to %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Chart\ColumnAndBar\BarChart_DifCol.cpt

    Click download template: 

    BarChart_DifCol.cpt


    Attachment List


    Theme: FineReport チャート
    既に最初
    既に最後
    • Helpful
    • Not helpful
    • Only read