1.2.3 • Published 6 years ago

@whcg/whcg-chart-feeder v1.2.3

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

<whcg-chart-feeder>

<whcg-chart-feeder whcgjsoninput="[[whcgElectricityJson]]" datapackage="yearlyamounts" chartjs="{{chartJsJson2}}"></whcg-chart-feeder>

Getting started

<whcg-chart-feeder> is a component that converts WHCG formated json data into Chartjs.org fortmat. Example of WHCG format:

{
    "result": [{
        "object": "Elkostnad",
        "data": {
            "yearlyamounts": {
                "label": "öre/kWh",
                "dataset": {
                    "2018": 40,
                    "2014": 60,
                    "2010": 100
                } 
            },
            "suppliers": {
                "label": "Leverantör",
                "dataset": {
                    "2018": 56,
                    "2014": 234,
                    "2010": 45
                }  
            }
        }
    }, {
        "object": "Vattenkostnad",
        "data": {
            "yearlyamounts": {
                "label": "kr/m3",
                "dataset": {
                    "2018": 400,
                    "2014": 607,
                    "2010": 100
                } 
            },
            "suppliers": {
                "label": "Leverantör",
                "dataset": {
                    "2018": 76,
                    "2014": 37,
                    "2010": 77
                }  
            }
        }
    }, {
        "object": "Hyresintäkter",
        "data": {
            "yearlyamounts": {
                "label": "kr",
                "dataset": {
                    "2018": 140,
                    "2014": 260,
                    "2010": 10
                } 
            },
            "suppliers": {
                "label": "Hyresgäst",
                "dataset": {
                    "2018": "Olle",
                    "2014": "Adam",
                    "2010": "Stina"
                }  
            }
        }
    }]
}

Dependencies

<whcg-chart-feeder> is a Polymer 3 element with the following dependencies:

  • npm i @polymer/polymer
1.2.3

6 years ago

1.2.2

6 years ago

1.2.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago