FVS Picture API

This document is applicable to users who have installed the FineVis Data Visualization plugin to learn plugin functions.

Version

Report Server VersionPlugin VersionFunctional Change
11.0.16 V1.15.1Adapted FVS chart components to the API.
11.0.22 V3.3.0  Added stopAutoTooltip and moveOnAutoTooltip APIs.
iconNote: 
The following APIs cannot be used in the components of extended charts.

duchamp.getWidgetByName

 

API duchamp.getWidgetByName("widgetName") 

To get the chart component object, allowing you to use the APIs and attributes of the obtained component.

iconNote: 
Currently, the API cannot be used to get charts of reports.


Parameter widgetName The name of the FVS picture component.

Returned 

Value 

object The current chart component object.
 Example 

Example: You can get the object of Column Component.

duchamp.getWidgetByName("Column Component");

Application Example -

 Mobile 

Terminal

 This API is supported on mobile terminals.

getSeries

API   getSeries()To get the array of series objects.
     Parameter --
Returned Value series[]The array of current chart component series.
  Example Example: You can get the array of series objects of Column Component

duchamp.getWidgetByName("Column Component").getSeries();

  Application Example -
Mobile Terminal  This API is supported on mobile terminals.


series

API series[seriesIndex] To get series objects.
      Parameter seriesIndexThe default chart object with a series property stores information about the series within the chart as an array of objects. If you want to get a specific series object in the chart, you need to specify the corresponding index seriesIndex which counts from 0.
ExampleExample: You can get the first series object of the Column Component object.

var series=duchamp.getWidgetByName("Column Component").getSeries();

console.log(series[0]);

iconNote: 
The correct statement is getSeries()[0] instead of getSeries().series[0].
Application Example -

Mobile 

Terminal 

This API is supported on mobile terminals.

Series Attribute

AttributeType  Description
points Array All data points in the current series
nameStringName of the current series, consistent with the series name shown in the legend.
typeStringChart type of the current series. The following figure shows the currently included types.

series.points

APIseries.points[pointIndex] 

To get the object of the data point.

To be used after you get the chart series object.

ParameterpointIndex 

The points attribute in each series object is also an array of objects, where the point data point objects you want to get are stored.

If you want to get a specific data point object, you need to specify the corresponding index pointIndex which counts from 0.

Example

Example: You can get the first data point in the first series object of the Column Component object.

duchamp.getWidgetByName("Column Component").getSeries()[0].points[0];

Mobile Terminal This API is supported on mobile terminals.

Points Attribute

Attribute Type  Description
name String The area name of the current data point in the area map, such as Jiangsu province and Nantong city.
seriesName StringThe name of the series where the current data point is located.
categoryString

The name of the category where the data point is located in the axis chart.

categroyArray  Array  The name of the category array where the data point is located in the axis chart with multiple categories.
value Number 

The value corresponding to the data point on the value axis in the axis chart.

icon

 

Note: 


The value of the scatter chart corresponds to the value of the selected field under Data > Value.


seriesObjectThe series where the current data point is located.

setSeriesVisible

API   setSeriesVisible()  To display some series on a chart.
  Parameter  seriesIndex[] 

seriesIndexnumber

Different series of a chart, counting from 0

 Returned Value
--
 Example 

Example: The series 1 and series 2 of the column component can be displayed.

duchamp.getWidgetByName("Component name").setSeriesVisible([0,1]);

 Application Example -
Mobile TerminalThis API is supported on mobile terminals.

sortChart

API  sortChart(sortType)To sort data in a chart.
 Parameter   sortType The sorting rule, namely 1 for ascending, -1 for descending, and the null value for switching between ascending and descending.
  Returned Value--
Example Example:

duchamp.getWidgetByName("Column Component").sortChart();

Application Example -

Mobile 

Terminal

This API is supported on mobile terminals.

openAutoTooltip

iconNote: 
This API can only be used for special-shaped column charts in extended charts.
API openAutoTooltip([delay, initPoints]) To display tooltips of data points in turn.
  Parameter  delay, initPoints 

delay: the interval for data point tooltips (3s by default).

initPoints: the set of data points corresponding to the carousel data point tooltips, which defaults to all data within the chart.

iconNote: 
initPoints can only be used in V2.4.0 and later versions.


Returned 

Value 

--
Example Example 1:

duchamp.getWidgetByName("Column Component").openAutoTooltip(3000);

iconNote: 
3000 refers to the carousel interval (3s), which can be modified as needed.

Example 2: You can display tooltips of all data points of the first series in turn. 

var vanchart=duchamp.getWidgetByName("Chart Component");

vanchart.openAutoTooltip(1000,vanchart.getSeries()[0].points);

// The data points refer to all data points of the first series.

 Application Example Realizing Data Point Tooltip Carousel in the FVS Regular Chart

Mobile 

Terminal 

This API is supported on mobile terminals.

stopAutoTooltip

iconNote: 
This API can only be used for special-shaped column charts in extended charts.
APIstopAutoTooltip() 

To pause the carousel display of data points tooltips.

iconNote: 
This API should be used after you enable the openAutoTooltip API.
Parameter--
Returned Value--
Example Example: You can pause the carousel display of data point tooltips.

duchamp.getWidgetByName("Column component").stopAutoTooltip();

Application ExampleRealizing Data Point Tooltip Carousel in the FVS Regular Chart

Mobile 

Terminal

 This API is supported on mobile terminals.

moveOnAutoTooltip

iconNote:
This API can only be used for special-shaped column charts in extended charts.

 

API  moveOnAutoTooltip() 

To continue the carousel display of data points tooltips.

icon

 

Note:


Continuing the carousel display from where it was paused requires you to enable the stopAutoTooltip API.
Parameter --

Returned 

Value

--
Example Example: You can continue the carousel display of data points tooltips.

duchamp.getWidgetByName("Column Component").moveOnAutoTooltip();

Application ExampleRealizing Data Point Tooltip Carousel in the FVS Regular Chart

Mobile 

Terminal  

This API is supported on mobile terminals.

setMapZoom

API setMapZoom(mapZoom)  To set the zoom level and center of a map.
Parameter

 MapZoomProps = {

  zoomLevel: number | string;

  viewCenter:  [number, number];

};

zoomLevel: the zoom level, whose value can be set from 0 to 18. The greater the value is, the higher the level will be, with a more detailed map and a smaller range of latitude and longitude displayed.

viewCenter: the center point, [longitude, latitude].

 Returned Value--
 Example 

Example:

duchamp.getWidgetByName("Map1").setMapZoom({zoomLevel: 5, viewCenter: [110, 40]});

Application Example -
 Mobile Terminal  This API is supported on mobile terminals.

getZoom

API getZoom()To get the zoom level of a map.
  Parameter--
 Returned Value number The zoom level value (from 0 to 18). The greater the value is, the higher the level will be, with a more detailed map and a smaller range of latitude and longitude displayed.
     Example Example:

duchamp.getWidgetByName("Map1").getZoom();

Application Example -
Mobile Terminal This API is supported on mobile terminals.

getCenter

API  getCenter()   To get the center point of a map.
     Parameter --
Returned Value  [number, number]The center point, [longitude, latitude].
   Example Example:

duchamp.getWidgetByName("Map1").getCenter();

Application Example -
Mobile Terminal This API is supported on mobile terminals.

panTo

API panTo(center) To change the center point of a map.
    Parameter   center 

The center point, [latitude, longitude].

icon Note:
In the panTo API, the Longitude value is in front of the Latitude value.


  Returned 

Value

--
Example 

Example:

duchamp.getWidgetByName("Map1").panTo([40,118]); // Change the center point according to the longitude and latitude values.

  Application Example -

Mobile 

Terminal 

This API is supported on mobile terminals.

drillDown

API  drillDown(area) To drill down on a map.
 Parameter  area  A set of information corresponding to the name area not just the name of an area, which can be obtained from the area name.
   Returned Value--
Example Example:

var chart =duchamp.getWidgetByName("Drilling Area Map1_Page1");// To get the chart.

var quyu = duchamp.getWidgetByName("Province").getValue(); // To get the value of the drop-down box widget.

if (chart.getLayerIndex() > 0)

 chart.drillUp(chart.getLayerIndex() - 1); // If you have already drilled down an area of the map, you can click on another area to go back to the previous level and drill down again.

var areas = [];

chart.getSeries().forEach(ser => areas.push(...ser.points));

var len = areas.length;

for (var i = 0; i < len; i++) {

 if (areas[i].name == quyu) {

  chart.drillDown(areas[i]);

  break;

 }

 }

Application Example -
Mobile TerminalThis API is supported on mobile terminals.

 drillUp

API drillUp(index) To drill up on a map.
Parameterindex  index: natural numbers starting from 0, which indicate drill-down levels.

Returned 

Value

--
Example Example:

var chart =duchamp.getWidgetByName("Drilling Area Map1_Page1");// To get the chart.

var quyu = duchamp.getWidgetByName("Province").getValue(); // To get the value of the drop-down box widget.

if (chart.getLayerIndex() > 0)

 chart.drillUp(chart.getLayerIndex() - 1); // If you have already drilled down an area of the map, you can click on another area to go back to the previous level and drill down again.

var areas = [];

chart.getSeries().forEach(ser => areas.push(...ser.points));

var len = areas.length;

for (var i = 0; i < len; i++) {

 if (areas[i].name == quyu) {

  chart.drillDown(areas[i]);

  break;

 }

 }

Application 

Example 

-

Mobile 

Terminal 

 This API is supported on mobile terminals.

getLayerIndex()

APIgetLayerIndex()   To get the current drill hierarchy of a drill map, with levels starting from 0.
     Parameter --
  Returned Value number  To get the current drill-down level of a map.
Example Example:

duchamp.getWidgetByName("Drilling Map1").getLayerIndex();

 Application Example API for Getting the Current Level of Drilling Map.fvs
Mobile TerminalThis API is supported on mobile terminals.

getLayerNames()

API getLayerNames()  To get the name array of a drill directory, such as ["America", "State of New York", "New York City"].
     Parameter --
Returned Valuestring[] Array, such as ["America", "State of New York", "New York City"].
Example Example:

duchamp.getWidgetByName("Drilling Map1").getLayerNames();

 Application 

Example 

API for Getting the Current Level of Drilling Map.fvs
Mobile Terminal This API is supported on mobile terminals.

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