ioBroker.vis-materialdesign
ioBroker.vis-materialdesign copied to clipboard
Bar Chart: tooltipText wrong when json ist changed
Hi,
I use the Bar Chart to visalize some json data. I also have some buttons to change the JSON data that is displayed (pressing the button changes the timeframe of the displayed data between week and month). This works fine so far, when you press the button, the new data will be loaded by the widget and displayed, but the tooltipText is wrong (will not be updated).
To Reproduce
Steps to reproduce the behavior:
- Create a datapoint to hold the json data.
- Create a Bar Chart in vis, change to "JSON String", add the datapoint and for my example use horizontal display (but this should not be the problem, ist just for my example data)
- add the following JSON-String:
[{
"label": "Milchschaum",
"value": "14",
"dataColor": "#81645a",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Milchschaum: 14"
}, {
"label": "Caffè XL",
"value": "12",
"dataColor": "#7a6056",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Caffè XL: 12"
}, {
"label": "Cappuccino",
"value": "10",
"dataColor": "#745b52",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Cappuccino: 10"
}, {
"label": "Flat white",
"value": "9",
"dataColor": "#6e564d",
"tooltipTitle": "Kaffeewelt",
"tooltipText": "Anzahl Flat white: 9"
}, {
"label": "Caffè Grande",
"value": "9",
"dataColor": "#685149",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Caffè Grande: 9"
}, {
"label": "Latte macchiato",
"value": "8",
"dataColor": "#624c45",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Latte macchiato: 8"
}, {
"label": "Espresso doppio",
"value": "4",
"dataColor": "#5c4840",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Espresso doppio: 4"
}, {
"label": "Cortado",
"value": "2",
"dataColor": "#55433c",
"tooltipTitle": "Kaffeewelt",
"tooltipText": "Anzahl Cortado: 2"
}, {
"label": "Caffè Crema",
"value": "2",
"dataColor": "#4f3e38",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Caffè Crema: 2"
}, {
"label": "Espresso",
"value": "1",
"dataColor": "#43342f",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Espresso: 1"
}, {
"label": "Wiener Melange",
"value": "1",
"dataColor": "#3d2f2b",
"tooltipTitle": "Kaffeewelt",
"tooltipText": "Anzahl Wiener Melange: 1"
}, {
"label": "Warme Milch",
"value": "1",
"dataColor": "#372b26",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Warme Milch: 1"
}, {
"label": "Milchkaffee",
"value": "1",
"dataColor": "#302622",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Milchkaffee: 1"
}
]
-
reload vis, you shoud see somethin like this:
-
change the datapoint JSON content to this:
[{
"label": "Milchschaum",
"value": "4",
"dataColor": "#745b52",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Milchschaum: 4"
}, {
"label": "Flat white",
"value": "4",
"dataColor": "#685149",
"tooltipTitle": "Kaffeewelt",
"tooltipText": "Anzahl Flat white: 4"
}, {
"label": "Caffè XL",
"value": "3",
"dataColor": "#5c4840",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Caffè XL: 3"
}, {
"label": "Cappuccino",
"value": "2",
"dataColor": "#4f3e38",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Cappuccino: 2"
}, {
"label": "Latte macchiato",
"value": "1",
"dataColor": "#43342f",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Latte macchiato: 1"
}, {
"label": "Milchkaffee",
"value": "1",
"dataColor": "#372b26",
"tooltipTitle": "Getränke",
"tooltipText": "Anzahl Milchkaffee: 1"
}
]
- switch back to vis, you will see this:
As you can see, the data in the datpoint was reloaded, but the tooltipText content remains the same as before.
Expected behavior
The tooltipText should display the new value from the datapoint JSON-String.
Browser Consolen log File
console-1678022204135.log
Widget, View or Project Export widget-export.zip
JSON Data see description
Screenshots see description
Versions:
- Adapter version: 0.5.9
- JS-Controller version: 4.0.24
- Node version: v16.18.1
- VIS Adapter version: 1.4.16
Additional context
none