Range Area Chart

  • Last update:December 25, 2024
  • Overview

    Version

    Report Server Version
    11.0

    Expected Effect

    The area chart can be set to display the data range, as shown in the following figure.

    Implementation Method

    You can add a condition attribute to a chart, set the color and line style for the chart to display the data range by area, and customize the label and prompt as needed through JS.

    Example

    Data Preparation

    Choose File > New General Report, and create a built-in dataset ds1 on the lower left of the designer, as shown in the following figure. 

    Chart Insertion

    Merge required cells, click the Insert Chart icon on the upper toolbar, and select Stacked Area Chart, as shown in the following figure. 

    Chart Data

    Select the area chart and bind the data, as shown in the following figure.

    Chart Attribute Setting

    1. Prerequisite

    If you need to set the opacity by adding condition attributes, you first need to set Gradient Style to Off under Style > Series. Otherwise, the opacity cannot be set.

    2. Procedure

    Choose Special Effect > Condition Display, click xxx, and add a condition attribute Series Index Equal to 1, as shown in the following figure.

    Chart Style Setting

    1. Choose Style > Label, select Use Label, and select Custom for the returned content. Through the JavaScript codes, the label value displayed for the Difference series is the sum of the values of the Difference and Lowest series.

    Enter the following JavaScript codes.

       function(){
     if(this.seriesName=="Difference"){
          return (this.points[0].value+this.points[1].value).toFixed(1); //If the series is Difference, the system returns the sum of the values of the Difference and Lowest series, with one decimal place kept.
          };
          return this.value; //The actual value, namely, the value of the Lowest series, is returned
    .}

    2. Choose Style > Prompt, select Use Tooltip, and select Custom for the returned content. Enter the following JavaScript codes.

       function(){   
      var value="<font color='white'>"+this.category+"<br>Lowest:"+this.points[0].value+"<br>Highest:"+(this.points[0].value+this.points[1].value).toFixed(1)+"</font>";
      return value;
    }

    3. Choose Style > Prompt, and select Display All Series to display all data tooltips of all series connected by lines.

    Effect Display

    PC

    Save the report and click Pagination Preview. The following figure shows the preview effect.

    Mobile Terminal

    The report can be previewed on both the DataAnalyst app and H5 terminal. The following figure shows the effect.

    Note: On the mobile terminal, the labels are displayed normally. However, the tooltip does not show the highest value but still displays the difference.

    Template Download

    For details, you can download the template Range Area Chart.cpt

    Attachment List


    Theme: Chart
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    9s后關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy