优特云
[ { "name": "首页", "url": "http://www.utyun.com/", "target": "0", "child": [] }, { "name": "活动", "url": "http://www.utyun.com/h-col-141.html", "target": "0", "child": [] }, { "name": "产品", "url": "", "target": "1", "child": [ { "name": "U语言", "url": "http://www.utyun.com/h-col-176.html", "target": "0", "child": [] }, { "name": "U平台", "url": "http://www.utyun.com/h-col-150.html", "target": "0", "child": [] } ] }, { "name": "技术与服务", "url": "", "target": "1", "child": [ { "name": "运维服务", "url": "http://www.utyun.com/h-col-161.html", "target": "0", "child": [] }, { "name": "技术方案", "url": "http://www.utyun.com/h-col-178.html", "target": "0", "child": [] } ] }, { "name": "优特云学院", "url": "", "target": "1", "child": [ { "name": "教程", "url": "http://www.utyun.com/h-col-166.html", "target": "0", "child": [] }, { "name": "下载中心", "url": "http://www.utyun.com/h-col-170.html", "target": "0", "child": [] }, { "name": "论坛", "url": "http://www.utyun.com/h-col-169.html", "target": "0", "child": [] } ] }, { "name": "关于优特云", "url": "", "target": "1", "child": [ { "name": "企业概况", "url": "http://www.utyun.com/h-col-171.html", "target": "0", "child": [] }, { "name": "新闻动态", "url": "http://www.utyun.com/h-col-172.html", "target": "0", "child": [] }, { "name": "加入我们", "url": "http://www.utyun.com/h-col-173.html", "target": "0", "child": [] }, { "name": "团队风采", "url": "http://www.utyun.com/h-col-140.html", "target": "0", "child": [] } ] } ]
展示组件1
地图图表

用户5594 最后一次编辑

4 个月前 8


Description: Map Chart widget is useful for data visualizations on a map. The visualizations can be used in dashboards to denote areas of interest.

Map Chart

This page provides information on using the Map Chart widget for data visualizations on maps. The visualizations can be used in dashboards to denote areas of interest.

<ZoomImage src="/img/mapschart.png" alt="Display Map Chart" caption="Display Map Chart" />

:::info
Appsmith is integrated with FusionCharts and has acquired a re-distribution license. This license lets you use FusionCharts on the Appsmith cloud and self-hosted platforms. The use of the license is permitted as long as what you are building on Appsmith isn't used to compete with FusionCharts.

:::

Content properties

These properties are customizable options present in the property pane of the widget, allowing users to modify the widget according to their preferences.

Data

Map Type string

Allows you to choose between world maps or individual continent maps for visualizing your data.

Options:

  • World
  • World with Antarctica
  • Europe
  • North America
  • South America
  • Asia
  • Oceania
  • Africa
  • USA

:::info
If you want to display a different Map type not listed above, like specific locations, countries, or cities, please contact the support team using the chat widget at the bottom right of this page.
:::

Chart Data array<object>

Allows you to display data in the chart.

Expected data structure:

[
  {
    "id": "AK",
    "value": "1.96"
  },
  {
    "id": "AL",
    "value": "2.22"
  },..
]

In this format, the id refers to the pre-defined label ID available on Fusioncharts under the section List of Entities, and the value represents the corresponding value associated with that label. If a label ID has no corresponding value, the map displays grey color, to signify the absence of data.

Each Map Type has different configurations. To learn more about these charts and their specific configurations, you can refer to the official FusionCharts documentation.

Additionally, you can display dynamic data from queries or JS functions by binding the response to the Chart data property. For example, if you have a query named fetchData, you can bind its response using:

Example:

{{fetchData.data}}

If the query data is not in the expected format, you can use the map() function to transform it before passing it to the widget, like:

Example:

{{fetchUserData.data.map( p => ({id: p.label, value: val.count}))}}

Title string

Sets the text that appears at the top of the chart as a title.

Visible boolean

Controls the visibility of the widget. If you turn off this property, the widget would not be visible in View Mode. Additionally, you can use JavaScript by clicking on JS next to the Visible property to conditionally control the widget's visibility.

For example, if you want to make the widget visible only when the user selects "Yes" from a Select widget, you can use the following JavaScript expression:

{{Select1.selectedOptionValue === "Yes"}}

Show Labels boolean

When enabled, displays labels for each data point featured on the Map chart.

Events

onDataPointClick

Sets the action (Framework functions, queries, or JS functions) to be executed when a user clicks on a data point in the chart.

Style properties

Style properties allow you to change the look and feel of the widget.

General

Color range array<object>

Allows you to manage the color of a collection of regions based on the assigned value ranges. It accepts arrays of objects containing the following keys:

`code`: Represents the color code to be applied.
  • minValue: Indicates the minimum value where this color should be used.
  • maxValue: Indicates the maximum value where this color should be used.
  • displayValue: Display string values, overriding the numeric range.
  • alpha: Indicates the transparency level, with a maximum value of 100.
  • Expected data structure:

    [
      {
        "minValue": 0.5,
        "maxValue": 1,
        "code": "#FFD74D"
      },
      {
        "minValue": 1,
        "maxValue": 2,
    	"displayValue": "Hello",
    	"alpha": 32,
        "code": "#FB8C00"
      },..
    ]
    

    Border and shadow

    Border radius string

    Applies rounded corners to the outer edge of the widget. If JavaScript is enabled, you can specify valid CSS border-radius to adjust the radius of the corners.

    Box Shadow string

    This property adds a drop shadow effect to the frame of the widget. If JavaScript is enabled, you can specify valid CSS box-shadow values to customize the appearance of the shadow.

    Reference properties

    Reference properties are properties that are not available in the property pane but can be accessed using the dot operator in other widgets or JavaScript functions. They provide additional information or allow interaction with the widget programmatically. For instance, to get the visibility status, you can use MapChart1.isVisible.

    selectedDataPoint object

    Contains an object which represents the data point that the user has most recently clicked.

    Example:

    //To access all the details of the selected data point:
    {{MapChart1.selectedDataPoint}}
    
    //To ac cess the label of the selected data point:
    {{MapChart1.selectedDataPoint.id}}
    
    //To access the value of the selected data point:
    {{MapChart1.selectedDataPoint.value}}
    

    isVisible boolean

    Reflects whether the widget is visible or not.

    Example:

    {{MapChart1.isVisible}}
    

    Methods

    Widget property setters enable you to modify the values of widget properties at runtime, eliminating the need to manually update properties in the editor.

    These methods are asynchronous and return a Promise. You can use the .then() block to ensure execution and sequencing of subsequent lines of code in Appsmith.

    setVisibility (param: boolean): Promise

    Sets the visibility of the widget.

    Example:

    MapChart1.setVisibility(true)
    

    优特云