Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PLOTLY_AREAArea Graph
PLOTLY_BARBar Chart
PLOTLY_BOXPLOTBox Plot
PLOTLY_BUBBLEBubble Chart
PLOTLY_HISTHistogram
PLOTLY_H_BARHorizontal Bar Chart
PLOTLY_H_HISTHorizontal Histogram
PLOTLY_LINELine Chart
PLOTLY_PIEPie Chart
PLOTLY_SCATTERScatter Plot
PLOTLY_TSTime Series

...

Formatting Tabulations

  • In this example we will create a dataProvider object that can be used with amCharts. We will assume that we have a collection named "test" and  and a view named "view" with  with a variable named "var" that  that has the values 1, 2, and 3. In this example we will run a tabulation that will count the frequencies of each of these values that could be used to create a chart.
  • Running the tabulation would normally look something like this:

    Code Block
    titleTabulation
    http://{host}/rds/api/catalog/test/view/tabulate?dims=var


    Code Block
    titleTabulation Output
    collapsetrue
     {
        "records": [
            [
                1,
                182
            ],
            [
                2,
                354
            ],
            [
                3,
                126
            ]
        ],
        "info": {
            "colCount": 2,
            "format": "MTNA",
            "includeMetadata": false,
            "limit": 20,
            "offset": 0,
            "moreRows": false
        }
    }


  • We can look at some of the formatting changes by running several of the different formats.

    Code Block
    titlePie Chart
     http://{host}/rds/api/catalog/test/view/tabulate?dims=var&format=plotly_pie


    Code Block
    titlePie Output
    collapsetrue
     [
        {
            "values": [
                182,
                354,
                126
            ],
            "labels": [
                "1",
                "2",
                "3"
            ],
            "type": "pie"
        }
    ]


    Code Block
    titleBar Chart
     http://{host}/rds/api/catalog/test/view/tabulate?dims=var&format=plotly_bar


    Code Block
    titleBar Output
    collapsetrue
    [
        {
            "x": [
                1,
                2,
                3
            ],
            "y": [
                182,
                354,
                126
            ],
            "type": "bar"
        }
    ]

     

     

  • In addition to formatting the values in a Plotly compliant way, we can also substitute the numeric values for the categories they represent if the variable has a classification associated with it. In this example we will assume that var has the following classification:

    1METROPOLITAN AREA
    2TOWN OR CITY
    3OPEN COUNTRY


    Code Block
    titlePie Chart
     http://{host}/rds/api/catalog/test/view/tabulate?dims=var&format=plotly_pie


    Code Block
    titlePie Output
    collapsetrue
    [
        {
            "values": [
                182,
                354,
                126
            ],
            "labels": [
                "METROPOLITAN AREA",
                "TOWN OR CITY",
                "OPEN COUNTRY"
            ],
            "type": "pie"
        }
    ]


    Code Block
    titleBar Chart
     http://{host}/rds/api/catalog/test/view/tabulate?dims=var&format=plotly_bar


    Code Block
    titleBar Output
    collapsetrue
    [
        {
            "x": [
                "METROPOLITAN AREA",
                "TOWN OR CITY",
                "OPEN COUNTRY"
            ],
            "y": [
                182,
                354,
                126
            ],
            "type": "bar"
        }
    ]