From bac8a5d2822835cf47175d1162030653fadd5c09 Mon Sep 17 00:00:00 2001 From: johannst Date: Thu, 15 Feb 2024 23:29:57 +0000 Subject: deploy: 4485708c972815bbb6df7f5a228683aa855d553d --- web/chartjs.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'web/chartjs.html') diff --git a/web/chartjs.html b/web/chartjs.html index a30e67b..53ef44d 100644 --- a/web/chartjs.html +++ b/web/chartjs.html @@ -179,7 +179,7 @@

Chart.js

Minimal example with external tooltips

Rendered html

-
<canvas id="myChart" style="margin:5em;"></canvas>
+
<canvas id="myChart" style="margin:5em;"></canvas>
 
 <script>
 const get_or_create_tooltip = (id) => {
@@ -215,12 +215,12 @@ const render_tooltip = (context) => {
 
   // -- Format new tooltip.
   const link = document.createElement('a');
-  link.href =  "https://github.com/johannst";
-  link.innerHTML = "X:" + x + " Y:" + y;
+  link.href =  "https://github.com/johannst";
+  link.innerHTML = "X:" + x + " Y:" + y;
 
   // -- Remove previous child element and add new one.
   const table = tooltip_elem.querySelector('table');
-  table.innerHTML = ""; 
+  table.innerHTML = ""; 
   table.appendChild(link);
 
   // -- Get absolute X/Y position of the top left corner of the canvas.
@@ -232,9 +232,9 @@ const render_tooltip = (context) => {
   tooltip_elem.style.font = tooltip.options.bodyFont.string;
 
   // -- Place the tooltip (I) left or (II) right of the data point.
-  if (tooltip.xAlign === "right") {
+  if (tooltip.xAlign === "right") {
     tooltip_elem.style.transform = 'translate(-100%, 0)'; // (I)
-  } else if (tooltip.xAlign === "left") {
+  } else if (tooltip.xAlign === "left") {
     tooltip_elem.style.transform = 'translate(0%, 0)';    // (II)
   }
 }
-- 
cgit v1.2.3