Successfully!

Error!

Bar Chart with Interlaced Discoloration

  • Last update:  2022-01-20
  • 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 chartSpecial effect - Condition display.

    II. Example

    1. Design report

    1) Create a new normal report, create a new data queryds1, 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:

    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.

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


    2. Effect preview

    1) PC terminal

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

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

    2) Mobile terminal

    10.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: Chart
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback