add annotations and color fixup

This commit is contained in:
4cuck committed 2024-02-19 03:04:06 +01:00
1 parent 00bf7c701a
commit 5ccc610a59
1 file changed
+18 -1
+18 -1
View File
@@ -15,7 +15,8 @@ async function loadGraph() {
rangeSelectorPlotFillColor: 'MediumSlateBlue',
rangeSelectorPlotFillGradientColor: 'rgba(123, 104, 238, 0)',
colorValue: 0.9,
fillAlpha: 0.4
fillAlpha: 0.4,
colors: ['#008000', '#ffa500'],
/*rollPeriod: 14,
showRoller: true,
customBars: true,
@@ -27,6 +28,22 @@ async function loadGraph() {
fillAlpha: 0.4*/
}
);
g.ready(function() {
g.setAnnotations([
{
series: "Temperature",
x: "2023-05-18",
shortText: "G",
text: "First API Change"
},
{
series: "Temperature",
x: "2024-01-24",
shortText: "D",
text: "API Shutdown"
}
]);
});
} catch (error) {
console.error('Failed to fetch data:', error);
graphDiv.textContent = "Failed to load data.";