1. 统计图
应用 API
  • 开发指南
  • 字段类型对照表
  • 筛选器使用指南
  • 错误码
  • API 使用指南
  • 应用
    • 获取应用信息
      GET
    • 批量创建应用项分组
      POST
    • 批量创建应用项
      POST
  • 对话机器人
    • 新建对话机器人
      POST
  • 工作表
    • 获取工作表列表
      POST
    • 新建工作表
      POST
    • 获取工作表结构信息
      GET
    • 更新工作表结构
      POST
    • 删除工作表
      DELETE
    • 批量创建自定义动作
      POST
  • 工作表行记录
    • 获取行记录列表
      POST
    • 获取行记录详情
      GET
    • 更新行记录
      PATCH
    • 删除行记录
      DELETE
    • 新建行记录
      POST
    • 批量新增行记录
      POST
    • 批量更新行记录详情
      PATCH
    • 批量删除行记录
      DELETE
    • 获取关联记录
      GET
    • 获取行记录透视数据
      POST
    • 获取记录分享链接
      POST
    • 获取行记录日志
      GET
    • 获取行记录讨论
      GET
    • 获取审批流程执行详情
      GET
    • 根据行记录获取审批流程执行列表
      POST
  • 自定义页面
    • 更新自定义页面
  • 选项集
    • 获取选项集列表
    • 创建选项集
    • 编辑选项集
    • 停用选项集
  • 公共查询
    • 查找成员
    • 查找部门
    • 获取地区信息
  • 知识库
    • 获取应用下知识库列表
    • 知识库检索
  • 视图
    • 批量创建视图
  • 统计图
    • 新建统计图
      POST
  • 工作流
    • 获取触发流程列表
    • 创建工作流
    • 批量添加工作流节点
    • 删除工作流节点
    • 触发流程
    • 获取触发流程详情
    • 删除工作流
    • 获取工作流结构详情
    • 发布工作流
    • 校验工作流
  • 角色
    • 获取角色列表
    • 创建角色
    • 获取角色详情
    • 删除角色
    • 添加角色成员
    • 移除角色成员
    • 成员退出所有角色
  • 数据模型
    • Schemas
      • options
      • relation
      • obj_base_response
      • obj_field
      • obj_filter
      • obj_record_row
      • obj_record_log
      • obj_record_discussion
      • obj_pivot_meta
      • obj_pivot_dimensions
      • obj_pivot_data
      • obj_process
      • obj_process_detail
      • obj_input
      • obj_output
      • obj_role
      • obj_role_permission
      • obj_user
      • obj_user_desensitized
      • obj_department
      • obj_custom_page
      • obj_optionset
      • obj_filter_children
      • obj_app
    • 鉴权信息
    • 人员对象
    • 自定义页面
    • 应用角色
    • 人员信息
    • 统计图数值字段参数
    • FilterField
    • FilterTarget
    • ApiError
    • BatchCreateViewsRequest
    • DataScope
    • ViewItem
    • Aggregation
    • BatchCreateViewsResponse
    • TimeRange
    • ChartType
    • DynamicRangePoint
    • DimensionItem
    • MetricItem
    • SortItem
    • CreateChartData
    • InlineChartConfig
    • ViewConfig
    • TextConfig
    • HtmlConfig
    • CarouselConfig
    • ButtonActionItem
    • ButtonConfig
    • TabConfig
    • ContainerConfig
    • ChartComponent
    • SectionComponent
    • TextComponent
    • HtmlComponent
    • ViewComponent
    • CarouselComponent
    • ButtonComponent
    • TabComponent
    • ContainerComponent
    • SaveCustomPageComponent
    • SaveCustomPageData
    • ComponentConfig
    • SaveCustomPageRequest
    • app
    • CreateChartRequest
    • SaveCustomPageResponseData
    • CreateChartResponseData
    • ButtonItem
    • 基础返回对象
    • DimensionField
    • memberInfo
    • ValueField
    • department_with_path
    • SortField
    • departmentInfo
    • TimePointDynamic
    • regionInfo
    • process
    • process_detail
    • CustomDynamicRange
    • input
    • CustomRange
    • output
    • role
    • role_permission
    • optionset
    • field
    • CreateChartResponse
    • PageComponent
    • Position
    • filter_children
    • ErrorResponse
    • discussion
    • TabItem
    • SaveCustomPageResponse
    • User
    • WorkflowInputParameter
    • WorkflowOutputParameter
    • WorkflowNode
    • WorkflowValidationError
    • create_process_NodeRef
    • create_process_ValueRef
    • create_process_FieldValueRef
    • create_process_Filter
    • create_process_Condition
    • create_process_WorksheetEventTriggerConfig
    • create_process_ScheduleTriggerConfig
    • create_process_DateFieldTriggerConfig
    • create_process_WebhookTriggerConfig
    • create_process_TriggerSpec
    • batch_create_process_nodes_NodeRef
    • batch_create_process_nodes_ValueRef
    • batch_create_process_nodes_FieldValueRef
    • batch_create_process_nodes_RecordValueRef
    • batch_create_process_nodes_FieldPatch
    • batch_create_process_nodes_Filter
    • batch_create_process_nodes_Condition
    • batch_create_process_nodes_PersonRef
    • batch_create_process_nodes_AttachmentSpec
    • batch_create_process_nodes_FormProperty
    • batch_create_process_nodes_NodeSpec
    • batch_create_process_nodes_SortSpec
    • ApiResponseBase
    • WorkflowListType
    • WorkflowInstanceStatus
    • FlowNodeType
    • InstanceLogStatus
    • WorkItemOperationType
    • WorkItemLogAction
    • ApprovalAuthType
    • BatchRuleType
    • CallbackType
    • TriggerType
    • AppType
    • ApprovalResultBranchType
    • FailureCause
    • SignatureType
    • AppBrief
    • UserBrief
    • ControlValue
    • FlowNodeAuth
    • SelectNodeObject
    • FlowNode
    • InstanceLog
    • ProcessBrief
    • FileInfo
    • Signature
    • WorkItem
    • WorkItemLog
    • ChangedField
    • WorkflowInstance
    • BatchApprovalRequest
    • BatchApprovalInstance
    • BatchApprovalResult
    • OpinionRequest
    • ReturnRequest
    • bundled_2af3dc97c2fe
    • bundled_da9b1112b2d5
    • bundled_66310009f584
    • custom_page
    • worksheet
    • filter
    • record_row
  1. 统计图

新建统计图

正式环境
https://api.mingdao.com
正式环境
https://api.mingdao.com
POST
/v3/app/worksheets/{worksheet_id}/charts
在工作表下新建统计图。支持柱图、条形图、折线图、饼图、雷达图、漏斗图、双轴图、透视表、行政区划图、数值图、对称条形图、散点图、词云、仪表盘、进度条、排行榜、世界地图等图表类型。创建成功后返回 chartId。若未指定 chartType,默认使用 columnChart(柱图);若未指定时间范围,默认使用 currentMonth(本月);若未指定时间字段,默认使用 ctime(创建时间)。
图表生成约束:维度优先选择分类字段、时间字段或地区字段,不建议使用纯数值字段作为维度。指标必须是数值型字段或记录数 rowid;用户未指定聚合方式时,数值字段默认 SUM,rowid 计数默认 COUNT。趋势分析使用 lineChart,并优先/必须使用时间维度,可通过 granularity 指定粒度(常规趋势优先 3=月,短周期可用 1=日或 2=周)。regionMap/worldMap 仅在存在真实地区/定位字段时使用,不允许用普通文本字段作为地图维度。若字段不满足目标图表要求,应自动更换更合适的图表类型或补充提问,不要生成无法正确展示的图表。

请求参数

Authorization
Path 参数

Header 参数

Body 参数application/json

示例
{
    "chartName": "string",
    "viewId": "string",
    "chartType": "string",
    "dataScope": "string",
    "timeFieldId": "string",
    "timeRange": "string",
    "customDynamicRange": {
        "from": {
            "type": "string",
            "value": 0,
            "unit": "string"
        },
        "to": {
            "type": "string",
            "value": 0,
            "unit": "string"
        }
    },
    "customRange": {
        "startDate": "string",
        "endDate": "string"
    },
    "dimension": [
        {
            "field": "string",
            "displayName": "string",
            "granularity": 0,
            "includeEmpty": true
        }
    ],
    "rows": [
        {
            "field": "string",
            "displayName": "string",
            "granularity": 0,
            "includeEmpty": true
        }
    ],
    "columns": [
        {
            "field": "string",
            "displayName": "string",
            "granularity": 0,
            "includeEmpty": true
        }
    ],
    "values": [
        {
            "field": "string",
            "aggregation": "string",
            "displayName": "string"
        }
    ],
    "rightValues": [
        {
            "field": "string",
            "aggregation": "string",
            "displayName": "string"
        }
    ],
    "targetValues": [
        {
            "field": "string",
            "aggregation": "string",
            "displayName": "string"
        }
    ],
    "gaugeMin": "string",
    "gaugeMax": "string",
    "mapScope": "country",
    "mapRegionCode": "string",
    "filter": {
        "type": "group",
        "logic": "AND",
        "children": [
            {}
        ],
        "field": "string",
        "operator": "eq",
        "value": "string"
    },
    "sorts": [
        {
            "field": "string",
            "isAsc": true
        }
    ],
    "limit": 0
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://api.mingdao.com/v3/app/worksheets//charts' \
--header 'HAP-Appkey: {{appkey}}' \
--header 'HAP-Sign: {{sign}}' \
--header 'Content-Type: application/json' \
--data '{
    "chartName": "string",
    "viewId": "string",
    "chartType": "string",
    "dataScope": "string",
    "timeFieldId": "string",
    "timeRange": "string",
    "customDynamicRange": {
        "from": {
            "type": "string",
            "value": 0,
            "unit": "string"
        },
        "to": {
            "type": "string",
            "value": 0,
            "unit": "string"
        }
    },
    "customRange": {
        "startDate": "string",
        "endDate": "string"
    },
    "dimension": [
        {
            "field": "string",
            "displayName": "string",
            "granularity": 0,
            "includeEmpty": true
        }
    ],
    "rows": [
        {
            "field": "string",
            "displayName": "string",
            "granularity": 0,
            "includeEmpty": true
        }
    ],
    "columns": [
        {
            "field": "string",
            "displayName": "string",
            "granularity": 0,
            "includeEmpty": true
        }
    ],
    "values": [
        {
            "field": "string",
            "aggregation": "string",
            "displayName": "string"
        }
    ],
    "rightValues": [
        {
            "field": "string",
            "aggregation": "string",
            "displayName": "string"
        }
    ],
    "targetValues": [
        {
            "field": "string",
            "aggregation": "string",
            "displayName": "string"
        }
    ],
    "gaugeMin": "string",
    "gaugeMax": "string",
    "mapScope": "country",
    "mapRegionCode": "string",
    "filter": {
        "type": "group",
        "logic": "AND",
        "children": [
            {}
        ],
        "field": "string",
        "operator": "eq",
        "value": "string"
    },
    "sorts": [
        {
            "field": "string",
            "isAsc": true
        }
    ],
    "limit": 0
}'

返回响应

🟢200成功
application/json
创建成功
Bodyapplication/json

示例
{
    "success": true,
    "data": {
        "chartId": "68a1f3b2c9d04e5f67890abc",
        "view_id": "view_001",
        "worksheet_id": "worksheet_001",
        "chartName": "各状态需求数量",
        "chartType": "columnChart",
        "timeFieldId": "ctime",
        "timeRange": "last30Days"
    }
}
🟠400请求有误
🟠403禁止访问
修改于 2026-06-25 10:21:03
上一页
批量创建视图
下一页
获取触发流程列表
Built with