Skip to content

A module for the MagicMirror project which creates a SVG bar chart based on a list gathered from a json request.

Notifications You must be signed in to change notification settings

timdows/MMM-JsonGraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MMM-JsonGraph

A module for the MagicMirror project which creates a SVG bar chart based on a list gathered from a json request.

Example 1

End result:

Raw json response:

{
    "fitbitWeekOverviewItems": [
        {
            "steps": 10256,
            "displayText": "Today\t10256 steps"
        },
        {
            "steps": 13214,
            "displayText": "Friday\t13214 steps"
        },
        {
            "steps": 10554,
            "displayText": "Thursday\t10554 steps"
        },
        {
            "steps": 12942,
            "displayText": "Wednesday\t12942 steps"
        },
        {
            "steps": 9478,
            "displayText": "Tuesday\t9478 steps"
        },
        {
            "steps": 10690,
            "displayText": "Monday\t10690 steps"
        },
        {
            "steps": 12792,
            "displayText": "Sunday\t12792 steps"
        }
    ]
}

Configuration:

{
	module: 'MMM-JsonGraph',
	position: 'top_right',
	header: 'Fitbit steps last 7 days',
	config: {
		url: 'https://xyz/abc/get.json',
		arrayName: 'fitbitWeekOverviewItems',
		xAxisName: 'steps',
		textValue: 'displayText',
		updateInterval: 60000
	}
},

Installation

git clone https://github.com/timdows/MMM-JsonGraph.git

Config Options

Option Default Description
url "" The full url to get the json response from
arrayName null Define the name of the variable that holds the array to display
xAxisName "" Should be of the type number in order to determine the width of the bar
textValue "" The name of the variable in the array that holds text to display over the bar
updateInterval 15000 Milliseconds between the refersh

About

A module for the MagicMirror project which creates a SVG bar chart based on a list gathered from a json request.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published