JS Hide Gantt chart grid line

  • Last update:  2020-12-17
  • I. Overview

    1.1 Problem

    When we use the Gantt chart for report development, we will need to adjust its style. Most of the functions can be set through the style settings that come with the FineReport designer, but some need to be set using JS. The following is an example of hiding the Gantt chart grid lines.

    2020-12-06_23-53-35.png


    1.2 Solution

    Use JS to set the line stroke property in the chart to achieve the effect of hiding the grid lines.

    Note: Mobile terminal is not currently supported

    II. Example

    2.1 General report and Aggregation report

    Click Template -> Template Web Attributes -> Pagination Preview Settings -> select to set individually for this template-Add start loading event.

    image.png

    setTimeout(function() {
        $('.timeaxisGroup-inner-body-back line').css('stroke', 'unset');
    }, 1000);


    2.2 Dashboard

    Add an after initialization event to the form component, as shown in the following figure:

    2020-12-06_23-56-31.png

    Because the drop-down button of the parameter pane image (1).png will affect the JS implementation, so JS takes effect 1 second after initialization:

    setTimeout(function() {
        $('.timeaxisGroup-inner-body-back line').css('stroke', 'unset');
    }, 1000);
    setTimeout(function() {
        $(".parameter-container-collapseimg-up").bind("click", function() {
            setTimeout(function() {
        $('.timeaxisGroup-inner-body-back line').css('stroke', 'unset');
    }, 1000);
        });
        $(".parameter-container-collapseimg-down").bind("click", function() {
           setTimeout(function() {
        $('.timeaxisGroup-inner-body-back line').css('stroke', 'unset');
    }, 1000); 
        });
    }, 1000);

    Note: 1000 in the code means a delay of 1 second, which can be adjusted according to the actual application scenario.

    III. Preview effect

    The effect is shown in the figure below, and the grid lines have been hidden.

    2020-12-06_23-59-44.png

    IV. Download template

    Attachment List


    Theme: Secondary Development
    • Helpful
    • Not helpful
    • Only read

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

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

    不再提示

    10s後關閉

    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