Customize the Cursor Hovering Over the Chart

  • Last update:March 04, 2021
  • I. Overview

    1. Expected effect

    When the mouse is moved to the series of the chart, it is hoped that an eye-catching cursor will appear to prompt the user to operate, as shown in the following figure:


    C1AE3FBB-7C77-4A8A-9124-B30DCBEF7B96.GIF


    2. Implementation ideas

    Use JS to set the cursor as a custom picture, rename the custom picture cursor.png to「cursor.cur」, and put it in the %FR_HOME%\webapps\webroot\help\picture directory.

    Note: The image format must be .cur or .ani format.

    II. Example

    1. New General Report

    1) Create a New General Report, create a new data set ds1, the database query statement is: SELECT * FROM Sales_Volume

    1.png

    2) Merge a range of cells and insert a pie chart, as shown in the figure below to bind the chart data:

    2.png

    3) In the menu bar, select Template>Web Attributes>Pagination Preview>Individually set for the template, and then add a Loading End event, as shown in the following figure:

    3.png

    The JS code is as follows:

    setTimeout(function(){
    $("td[id^=A1-]").find("path").bind('mouseover',function()
         this.style.cursor="url('../../help/picture/cursor.cur'),pointer";
    })
    },1000)

    Note: A1 in td[id^=A1-] is the cell where the chart is located.


    2. Decision-making Report

    1) Drag the pie chart into the main body of the decision-making report design, and bind the chart data according to II.1.

    2) Add a After Initialization event to the pie chart, as shown in the following figure:

    4.png

    The JS code is as follows:

    setTimeout(function(){
    $("div[widgetname=CHART0]").find("path").bind('mouseover',function()
         this.style.cursor="url('../../help/picture/cursor.cur'),pointer";
    })
    },1000)

    Note: CHART0 in div[widgetname=CHART0] is the component name of the chart block, pay attention to all capitals.

    III. Template download

    The completed template can be found in:

    %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Primary\Chart\Customize the Cursor Hovering Over the Chart Example 1.cpt

    %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Primary\Chart\Customize the Cursor Hovering Over the Chart Example 2.frm

    Click to download the template:

    Customize the Cursor Hovering Over the Chart Example 1.cpt

    Customize the Cursor Hovering Over the Chart Example 2.frm

    Custom picture download:

    cursor.png

    Attachment List


    Theme: Chart
    Already the First
    Already the Last
    • 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