Dashboards elasticharts bar - kwantu/platformconfiguration GitHub Wiki

Simple Bar Chart

Layout

image

Note: Simple bar needs a xaxis and a value for all the records. To prepare this in datasource define field in field list (only one field) and a groupBy normally by document Id so that all docs comes in response. We also have to define the xAxis property. add this xAxis to groupBy to bring in response. also use any aggr function as we are using groupBy mostly we use sum or average. This will not make any difference as we are using groupBy document id

Config

"elasticChart": {
            "sdoSetId": "performanceQuarterlyDashboard:1",
            "uiView": "",
            "canEdit": "",
            "field": "percentTargetsMet",
            "chartType": "bar",
            "Label": "percentTargetsMet",
            "GroupBy": "_id",
            "Xaxis": "nodeName",
            "Yaxis": "",
            "Y1axis": "",
            "template": "{\"xAxis\":{\"type\":\"category\",\"data\":[]},\"yAxis\":{},\"series\":{\"data\":[],\"type\":\"bar\",\"showBackground\":true,\"backgroundStyle\":{\"color\":\"rgba(180, 180, 180, 0.2)\"}}}",
            "chart": "",
            "workflowStatus": "",
            "functionField": "sum",
            "acrossCommunity": false,
            "XaxisGrouping": false,
            "seriesField": "",
            "contextFilter": "",
            "GroupBy2": "nodeName",
            "GroupBy3": "",
            "GroupBy4": "",
            "GroupBy5": "",
            "filterMapping": []
          }

Rendered chart

image