Topic on Project:Support desk

access data in graph extension using aws api

4
SumanGadhawal (talkcontribs)

Hi All,

Could you please help me out to access data for graph(using graph extension) from aws api.

here is example(below) where I am using Data :values hard coded({"category":"HR", "members":100},) is there is any way to access data through aws api

department verses employee bar chart

<graph  mode=interactive >

{

  "width": 400,

  "height": 200,

  "padding": {"top": 10, "left": 30, "bottom": 20, "right": 10},

  "data": [

    {

      "name": "table",

      "values": [

        {"category":"HR", "members":100},

        {"category":"Technology", "members":500},

        {"category":"BDE", "members":200},

        {"category":"Retail", "members":91},

        {"category":"Customer", "members":81},

        {"category":"MD", "members":53},

        {"category":"Finance", "members":19},

        {"category":"R&D", "members":87},

        {"category":"Animation", "members":52}

      ]

    }

  ],

  "signals": [

    {

      "name": "tooltip",

      "init": {},

      "streams": [

        {"type": "rect:mouseover", "expr": "datum"},

        {"type": "rect:mouseout", "expr": "{}"}

      ]

    }

  ],

  "predicates": [

    {

      "name": "tooltip", "type": "==",

      "operands": [{"signal": "tooltip._id"}, {"arg": "id"}]

    }

  ],

  "scales": [

    { "name": "xscale", "type": "ordinal", "range": "width",

      "domain": {"data": "table", "field": "category"} },

    { "name": "yscale", "range": "height", "nice": true,

      "domain": {"data": "table", "field": "members"} }

  ],

  "axes": [

    { "type": "x", "scale": "xscale" },

    { "type": "y", "scale": "yscale" }

  ],

  "marks": [

    {

      "type": "rect",

      "from": {"data":"table"},

      "properties": {

        "enter": {

          "x": {"scale": "xscale", "field": "category"},

          "width": {"scale": "xscale", "band": true, "offset": -1},

          "y": {"scale": "yscale", "field": "members"},

          "y2": {"scale": "yscale", "value":0}

        },

        "update": { "fill": {"value": "steelblue"} },

        "hover": { "fill": {"value": "red"} }

      }

    },

    {

      "type": "text",

      "properties": {

        "enter": {

          "align": {"value": "center"},

          "fill": {"value": "#333"}

        },

        "update": {

          "x": {"scale": "xscale", "signal": "tooltip.category"},

          "dx": {"scale": "xscale", "band": true, "mult": 0.5},

          "y": {"scale": "yscale", "signal": "tooltip.members", "offset": -5},

          "text": {"signal": "tooltip.amount"},

          "fillOpacity": {

            "rule": [

              {

                "predicate": {"name": "tooltip", "id": {"value": null}},

                "value": 0

              },

              {"value": 1}

            ]

          }

        }

      }

    }

  ]

}

</graph>

Malyacko (talkcontribs)

What is "aws api"?

SumanGadhawal (talkcontribs)

Amazon web service API I mean if we created a get api on aws to access database and response of that api should be data in graph

Bawolff (talkcontribs)
Reply to "access data in graph extension using aws api"