This document is applicable to users who have installed the FineVis Data Visualization plugin to learn plugin functions.
Version
| Report Server Version | Plugin Version | Functional Change |
|---|---|---|
| 11.0.16 | V1.15.1 | Adapted FVS chart components to the API. |
| 11.0.22 | V3.3.0 | Added stopAutoTooltip and moveOnAutoTooltip APIs. |
Note: duchamp.getWidgetByName
| API | duchamp.getWidgetByName("widgetName") | To get the chart component object, allowing you to use the APIs and attributes of the obtained component. Note: |
|---|---|---|
| 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 | seriesIndex | The 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. |
| Example | Example: You can get the first series object of the Column Component object. var series=duchamp.getWidgetByName("Column Component").getSeries(); console.log(series[0]); Note: | |
| Application Example | - | |
Mobile Terminal | This API is supported on mobile terminals. | |
Series Attribute
| Attribute | Type | Description |
|---|---|---|
| points | Array | All data points in the current series |
| name | String | Name of the current series, consistent with the series name shown in the legend. |
| type | String | Chart type of the current series. The following figure shows the currently included types. |
series.points
| API | series.points[pointIndex] | To get the object of the data point. To be used after you get the chart series object. |
|---|---|---|
| Parameter | pointIndex | 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 | String | The name of the series where the current data point is located. |
| category | String | 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. ![]()
Note: |
| series | Object | The series where the current data point is located. |
setSeriesVisible
| API | setSeriesVisible() | To display some series on a chart. |
|---|---|---|
| Parameter | seriesIndex[] | seriesIndex: number 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 Terminal | This 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
Note: | 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. Note: |
Returned Value | - | - |
| Example | Example 1: duchamp.getWidgetByName("Column Component").openAutoTooltip(3000); Note: 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
Note: | API | stopAutoTooltip() | To pause the carousel display of data points tooltips. Note: |
|---|---|---|
| Parameter | - | - |
| Returned Value | - | - |
| Example | Example: You can pause the carousel display of data point tooltips. duchamp.getWidgetByName("Column component").stopAutoTooltip(); | |
| Application Example | Realizing Data Point Tooltip Carousel in the FVS Regular Chart | |
Mobile Terminal | This API is supported on mobile terminals. | |
moveOnAutoTooltip
Note:
| API | moveOnAutoTooltip() | To continue the carousel display of data points tooltips. ![]()
Note: |
|---|---|---|
| Parameter | - | - |
Returned Value | - | - |
| Example | Example: You can continue the carousel display of data points tooltips. duchamp.getWidgetByName("Column Component").moveOnAutoTooltip(); | |
| Application Example | Realizing 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]. Note: |
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 Terminal | This API is supported on mobile terminals. | |
drillUp
| API | drillUp(index) | To drill up on a map. |
|---|---|---|
| Parameter | index | 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()
| API | getLayerIndex() | 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 Terminal | This 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 Value | string[] | 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. | |