FVS JS API Summary

  • Last update:February 22, 2024
  • This document applies to users who have installed the FineVis Data Visualization plugin to learn plugin functions.

    Version

    Report Server Version JAR PackagePlugin VersionFunctional Change
    11.02021-11-15V1.0.0Added the lowest version requirement.

     API  Index

    Global API  

    Global APIs are mainly used for the FVS template. For details, see Global API - FR.

    InterfaceDescription

    duchamp

    Get the component object from the FVS template. It can be used in conjunction with the methods applicable to that object.

    servletURL

    Get the Servlet URL.

    serverURL 

    Get the server URL.

    server

    Get the server.

    fineServletURL

    Get the fineServletURL.

    SessionMgr.getSessionID

    Get the session ID.

    showDialog

    Open a dialog.

    closeDialog

    Close a dialog.

    doHyperlinkByGet

    Open a webpage using the GET method. It can be used to pass parameters and set the page property.

    doHyperlinkByPost

    Open a webpage using the POST method. It can be used to pass parameters and set the page property.

    Msg

    Open the built-in message box of FineReport (with a unified style), which can replace the alert, confirm, prompt, and toast pop-up boxes in Windows. For details, see FR.Msg.

    remoteEvaluate

    Execute FineReport built-in formulas and get the calculation result

    jsonEncode

    Encode the string using jsonEncode.

    jsonDecode

    Decode the string using jsonEncode.

    ajax

    It is an encapsulated jQuery.ajax() function.

    isEmpty

    Check if the object is empty.

    isArray

    Check if the object is an array.

    cellStr2ColumnRow

    Get row and column indexes based on the cell number.

    columnRow2CellStr

    Get the cell number based on the row and column number.

    exportTemplateExport FVS templates. 

    Page API 

    FVS page APIs are mainly used to obtain component objects from the page and page-related interfaces. 

    InterfaceDescription

    this

    Get the current component object. It can be used in conjunction with the methods and properties of that object.

    getAllWidgets

    Get all components from the current page.

    getWidgetByName

    Get a specific component from the current page.

    switchStory

    Switch to a page.

    nextStory

    Switch to the next page.

    previousStory

    Switch to the previous page.

    refresh

    Trigger the component refresh. Starting from FVS V1.9.1, it supports parameter passing while triggering the refresh.

    trigger

    Trigger all click events of the component.

    requestFullscreen

    Trigger the full screen.

    exitFullscreen

    Exit the full screen, only valid for the full-screen effect triggered by the requestFullscreen interface, not for that triggered by F11.

    reload

    Trigger an automatic refresh of a whole template.

    setPageButtonDisplayPolicy

    Set whether to display the page switching button.

    showStory

    Display pages when you preview a template.

    hideStory

    Hide pages when you preview a template.

    linkageGlobalImplement global parameter linkage.

    3D Component API 

    The FVS 3D component APIs are listed and described in the following table.

    InterfaceDescription

    getDataLayers

    Get all data layers of a 3D component.

    getDataLayerByName

    Get a specific data layer of a 3D component.

    animateSceneTime

    Set the scene time of a custom model to dynamically change, only valid for 3D custom scene components.

    getMeshByName

    Search for model objects based on the mesh name of a custom model and perform some operations on the model according to its properties.

    setVisible

    Set whether a model object is visible after obtaining it through getMeshByName.

    SetScaling

    Set the scaling ratio of a model object after obtaining it through getMeshByName.

    setRotation

    Set the rotation angle of a model object after obtaining it through getMeshByName.

    setPosition

    Set the position of a model object after obtaining it through getMeshByName.

    focus

    Set a model object to focus quickly after obtaining it through getMeshByName.

    rotateTo

    rotateForwardTo

    scaleTo

    moveTo

    Set motion effects such as the angle, orientation, scale, and position of a model object after obtaining it through getMeshByName.

    refreshData

    Pass parameters and refresh the data of a 3D component.

    subscribeMarkerData

    Subscribe to monitor data updates of 3D component data layers. It should be used with the refreshData interface.

    updateMarkerData

    Update the data of a specified model object in the 3D component data layer separately.

    getRoamAnimations

    Get all roaming path information of a 3D component (currently only returns the roaming path name).

    playRoamAnimations

    Play the roaming animation.

    updateRoamAnimationActionPause/Continue/Exit the roaming animation.

    Widget API 

    The FVS widget APIs are listed and described in the following table. For details, see General API for Widgets.

    InterfaceDescription

    getValue

    Get the actual value of a widget.

    iconNote:
    Starting from FVS V1.16.0, it can be used for the title component.


    getText


    Get the displayed value of a widget.

    setValue

    Set the value of a widget.

    setVisible

    Set whether a widget is visible or invisible.

    isVisible

    Indicate whether a widget is visible or invisible.

    setEnable

    Set whether a widget is usable or unusable.

    isEnabled

    Indicate whether a widget is usable or unusable.

    reset

    Reset a widget.

    setWaterMarkAdd watermark text (only valid for widgets with input boxes).

    Table Component API 

    Table APIs are used to modify the properties of table components.

    1. Table object APIs are used to locate cells in table components and set basic table properties. 

    InterfaceDescription
    getCell(row, col)Get a cell object of the row-th row and col-th column of the table.

    getRow(index)

    Get all cell objects of the index row of the table.

    getColumn(index)

    Get all cell objects of the index column of the table.

    getRowCount()

    Get the total number of rows after expansion in a table.

    getColumnCount()

    Get the total number of columns after expansion in a table.

    onMouseClick(func)

    Bind the click/tap events. The bound event is triggered when the table component is clicked or tapped.

    onMouseMoveInCell(func)

    Bind the cursor or finger move-in events. The bound event is triggered when the cursor/finger enters the cell.

    onMouseMoveOutCell(func)

    Bind the cursor or finger move-out events. The bound event is triggered when the cursor/finger moves out of the cell.

    scrollTo(opts)

    Set the table to automatically scroll to a certain position.

    getScrollOffset()

    Get the scroll offset of the table.

    setRadius(radius, range, single)

    Set rounded corners for all cells in the table. The cell must be set with the background color, otherwise the effect cannot be seen.

    showToolTip(opts)

    Set tooltips for all cells in the table.


    2. Table row/column APIs are mainly used for rows and columns in table components to set table row and column properties. 

    InterfaceDescription

    setHeight(height)

    Set the cell row height.

    setHeight()

    Get the cell row height

    setWidth(width)

    Set the cell column width.

    getWidth()

    Get the cell column width

    getCell()

    Get the cell object on the row-th row of a certain column or the cell object on the col-th column of a certain row.

    getIndex()

    Get the position index of the cell row object/cell column object.

    setStyle(opts)

    Set the style of a cell row/column object.

    showToolTip(opts)

    Add tooltips to cell rows/columns.


    3. Table cell APIs are mainly used for cells in table components to set the cell properties. 

    InterfaceDescription

    getPosition()

    Get the current cell position, requiring you to get the cell object first.

    getRow()

    Get the row object where the current cell is located. 

    getColumn()

    Get the column object where the current cell is located.

    getValue()

    Get the value of a cell.

    showToolTip(opts)Add tooltips to a cell.

    setStyle(opts)

    Set the cell style.

    Using APIs involving style parameters in the JS APIs to set the style properties conforms to the CSS specification, and the settable styles include the border, background, color, text, etc. 


    4. Page APIs of the table component are mainly used for the multi-page table component for page jumping or page number acquisition. For details, see Report Pagination API.

    InterfaceDescription

    gotoPreviousPage()

    Jump to the previous page of a table component.

    gotoNextPage()

    Jump to the next page of a table component.

    GotoLastPage()

    Jump to the last page of a table component.

    gotoFirstPage()

    Go to the first page of a table component.

    gotoPage()

    Jump to a specified page in a table component.

    getCurrentPageIndex()

    Get the current page number of a table component.

    getReportTotalPage()

    Get the total number of pages of a table component.


    5. The API for exporting tables can solely export table components as Excel files. For details, Report Export API.

    InterfaceDescription
    exportReportToExcel()Export a table component as an Excel file. 


    6. The following API is used to change the background color of a cell or the corresponding row/column when you click the cell or hover the cursor over it. 

    InterfaceDescription
    addEffect(type, opts)The background color of the cell or the corresponding row/column changes when you click the cell or hover the cursor over it.



    7.  Marquee API. For details, see Marquee API.

    InterfaceDescription
    startMarquee(opt)Start the marquee effect for a table component.
    stopMarquee()Stop the marquee effect of a table component.


    Tab Component API  

    The FVS Tab component APIs are listed and described in the following table.

    InterfaceDescription

    getShowIndex()

    Get the index of the currently displayed tab page in the Tab component.

    showCardByIndex()

    Display the n-th tab page in the Tab component.

    setTabVisible()

    Show/Hide a specific tab page and its content in the Tab component.


    Chart Component API

    The FVS chart component APIs are listed and described in the following table.

    iconNote:
    The following APIs do not support extended charts.

    InterfaceDescription

    getSeries()

    Get a series array of a chart component.

    series[seriesIndex]

    Get the series object of a chart component.

    series.points

    Get the data point object of a series after getting a chart series object.

    setSeriesVisible()

    Display some series on a chart.

    sortChart()

    Sort the data in a chart.

    openAutoTooltip()

    Display tooltips of data points on a chart in turn.

    iconNote:
    This API supports extended charts except for carousel-type charts.

    setMapZoom()

    Set the scale level and the center point of a map.

    getZoom()

    Set the scale level of a map.

    getCenter()

    Get the center point of a map.

    panTo()

    Change the center point of a map.

    drillDown()

    Drill down on a map.

    drillUp()

    Drill up on a map.

    getLayerIndex()

    Get the current drill hierarchy of a drill map, with levels starting from 0.

    getLayerNames()

    Get the name array of a drill directory, such as ["America", "State of New York", "New York City"].


    Iframe API 

    FVS Iframe APIs are used for the communication between FVS Iframes and the template page.

    InterfaceDescription
    onlyCommunicateWithOrigins

    Specify the origins for communication with FVS before communication, without which the communication cannot be performed.

    postMessage

    Send a message.

    addPostMessageListener

    Monitor the messages from the Iframe (specified by origins).

    removePostMessageListener

    Remove the listener added by addPostMessageListener.






    Attachment List


    Theme: FineVis Data Visualization
    • 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