An example of how to use key-mapping with Dashboard 2.0's ui-chart
node. It provides the option to parse data such as:
[
{
"time": "2023-11-14T19:00Z",
"screenTemperature": 10.03,
"maxScreenAirTemp": 10.4,
"minScreenAirTemp": 9.99,
"screenDewPointTemperature": 7.56,
"feelsLikeTemperature": 8.09,
"windSpeed10m": 3.86,
"windDirectionFrom10m": 263,
"windGustSpeed10m": 7.72,
"max10mWindGust": 10.13,
"visibility": 16258,
"screenRelativeHumidity": 84.48,
"mslp": 100360,
"uvIndex": 0,
"significantWeatherCode": 0,
"precipitationRate": 0,
"totalPrecipAmount": 0,
"totalSnowAmount": 0,
"probOfPrecipitation": 0
}, ...
]
Without the need for data manipulation before rendering, as we can use the built-in "key" properties for the x/y axes.
For example in the first chart we render, we set:
Which will render each point of the array using (time
, feelsLikeTemperature
) as coordinates.