Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Conversation

@EdwinBetanc0urt
Copy link
Member

@EdwinBetanc0urt EdwinBetanc0urt commented May 2, 2023

Add window chart parameters to filter on Window Metrics.

Request

http://localhost:8085/api/adempiere/dashboard/window/dashboards?page_size=15&ts=1681759182029&window_id=140&tab_id=100

Reponse

{
    "code": 200,
    "result": {
        "record_count": 1,
        "next_page_token": "",
        "records": [
            {
                "id": 1000004,
                "uuid": "9149ada4-a42b-403e-af88-2f513b79ae9a",
                "name": "Ventas por Grupo de Producto",
                "description": "",
                "sequence": 30,
                "is_collapsible": true,
                "is_open_by_default": true,
                "dashboard_type": "chart",
                "chart_type": "AC",
                "context_column_names": [],
                "transformation_script": "// Chart Line Type\nconst xAxisValues = []\nlet seriesToShow = []\nlet legendToShow = []\nconst allData = data.series\nconst dataSet = data.series.map(b => b.data_set)\nconst allDataValue = dataSet.map(currentSet => {\n  return currentSet.map(data => data)\n})\nallData.forEach(serie => {\n  serie.data_set.forEach(set => {\n    if (!xAxisValues.find(value => value === set.name)) {\n      xAxisValues.push(set.name)\n    }\n  })\n})\n\nconst listSerie = allData.map((currentData, key) => {\n  return {\n    name: currentData.name,\n    stack: 'vistors',\n    barWidth: '60%',\n    data: allDataValue[key],\n    smooth: true,\n    type: 'line',\n    animationEasing: 'quadraticOut',\n    lineStyle: {\n      width: 2\n    }\n  }\n})\n\nreturn {\n  xAxis: {\n    data: xAxisValues,\n    boundaryGap: false,\n    axisTick: {\n      show: false\n    }\n  },\n  toolbox: {\n    feature: {\n      magicType: {\n        type: ['stack', 'tiled']\n      },\n      dataView: {},\n      saveAsImage: {\n        pixelRatio: 2\n      }\n    }\n  },\n  grid: {\n    left: 10,\n    right: 10,\n    bottom: 20,\n    top: 30,\n    containLabel: true\n  },\n  tooltip: {\n    trigger: 'axis',\n    axisPointer: {\n      type: 'cross',\n      labelTextColor: '#5eff00',\n      bodyColor: '#5eff00'\n    },\n    backgroundColor: '#FFF',\n    labelTextColor: {\n      labelTextColor: '#5eff00',\n      bodyColor: '#5eff00'\n    },\n    bodyColor: '#5eff00'\n  },\n  yAxis: {\n    axisTick: {\n      show: false\n    }\n  },\n  legend: {\n    data: data.series.map(legendName => { return legendName.name })\n  },\n  series: listSerie\n}\n",
                "parameters": [
                    {
                        "id": 1000004,
                        "uuid": "459a695a-4051-4ae6-860c-57dea8d0ef75",
                        "name": "Date Invoiced",
                        "description": "",
                        "sequence": 20,
                        "column_name": "DateInvoiced",
                        "column_sql": "i.DateInvoiced BETWEEN(?, ?)",
                        "element_id": 267,
                        "field_id": 0,
                        "is_mandatory": false,
                        "is_range": true,
                        "default_value": "",
                        "display_type": 15,
                        "v_format": "",
                        "value_min": "",
                        "value_max": "",
                        "display_logic": "",
                        "read_only_logic": ""
                    },
                    {
                        "id": 1000003,
                        "uuid": "8685aa7b-1109-41d2-905c-c6523d9c0953",
                        "name": "Product Group Value",
                        "description": "",
                        "sequence": 10,
                        "column_name": "Value",
                        "column_sql": "g.Value LIKE '%?%'",
                        "element_id": 620,
                        "field_id": 0,
                        "is_mandatory": false,
                        "is_range": false,
                        "default_value": "",
                        "display_type": 10,
                        "v_format": "",
                        "value_min": "",
                        "value_max": "",
                        "display_logic": "",
                        "read_only_logic": ""
                    },
                    {
                        "id": 1000005,
                        "uuid": "c0f5e49a-d6ba-4c05-90a7-a276d993e7a3",
                        "name": "Is Sales",
                        "description": "",
                        "sequence": 30,
                        "column_name": "IsSold",
                        "column_sql": "p.IsSold = ?",
                        "element_id": 414,
                        "field_id": 0,
                        "is_mandatory": false,
                        "is_range": false,
                        "default_value": "",
                        "display_type": 20,
                        "v_format": "",
                        "value_min": "",
                        "value_max": "",
                        "display_logic": "",
                        "read_only_logic": ""
                    }
                ]
            }
        ]
    }
}

fixes https://github.com/solop-develop/frontend-core/issues/959

@EdwinBetanc0urt EdwinBetanc0urt added the enhancement New feature or request label May 2, 2023
@EdwinBetanc0urt EdwinBetanc0urt self-assigned this May 2, 2023
@EdwinBetanc0urt EdwinBetanc0urt merged commit 11a6be7 into solop-develop:experimental May 2, 2023
@EdwinBetanc0urt EdwinBetanc0urt deleted the feature/window-chart-parameter branch May 8, 2023 18:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crear tableros en Ventanas de dimensiones (SDN, Producto, etc)

1 participant