diff web/calibrate/XyPlot.ts @ 2419:e3af0ac507c8

new exposure-finder algorithm
author drewp@bigasterisk.com
date Tue, 21 May 2024 14:08:17 -0700
parents ae4b90efb55a
children
line wrap: on
line diff
--- a/web/calibrate/XyPlot.ts	Tue May 21 11:58:13 2024 -0700
+++ b/web/calibrate/XyPlot.ts	Tue May 21 14:08:17 2024 -0700
@@ -18,7 +18,7 @@
   chart!: echarts.ECharts;
   @property() label: string = "";
   @property() data: number[][] = [];
- 
+
   render() {
     return html`
       <fieldset>
@@ -52,10 +52,25 @@
   clear() {
     this.data.length = 0;
   }
-  
+
   insertPoint(x: number, y: number) {
     this.data.push([x, y]);
     this.data.sort((a, b) => a[0] - b[0]);
     this.chart.setOption({ series: [{ name: "d", data: this.data }] });
   }
+  setXMarklines(lines: { txt: string; x: number }[]) {
+    const markLineData = (row: { txt: string; x: number }, i: number) => ({ name: row.txt, label: { distance: 10*i, formatter: "{b} {c}", color: "#fff", textBorderWidth: 0 }, xAxis: row.x });
+    this.chart.setOption(
+      {
+        series: [
+          {
+            name: "d",
+            markLine: {
+              data: lines.map(markLineData),
+            },
+          },
+        ],
+      } //
+    );
+  }
 }