diff --git a/pages/examples/images/linechart.png b/pages/examples/images/linechart.png new file mode 100644 index 00000000..787215aa Binary files /dev/null and b/pages/examples/images/linechart.png differ diff --git a/pages/examples/index.html b/pages/examples/index.html index d67f41af..ec6a8cae 100644 --- a/pages/examples/index.html +++ b/pages/examples/index.html @@ -66,6 +66,24 @@ +
+
+
Line Chart
+
Render a basic line chart with markers switching
+
+
+ +
+
+ + + +
+
Multiple Series Types
diff --git a/pages/examples/noauth/linechart.html b/pages/examples/noauth/linechart.html new file mode 100644 index 00000000..6c61b533 --- /dev/null +++ b/pages/examples/noauth/linechart.html @@ -0,0 +1,145 @@ + + + + + Basic Charts + + + + + + +
+ + + + + \ No newline at end of file diff --git a/src/UXClient/Components/LineChart/LineChart.ts b/src/UXClient/Components/LineChart/LineChart.ts index f4adcb00..28c00c98 100644 --- a/src/UXClient/Components/LineChart/LineChart.ts +++ b/src/UXClient/Components/LineChart/LineChart.ts @@ -652,15 +652,16 @@ class LineChart extends TemporalXAxisComponent { } private importMarkers () { + // delete all the old markers + if (Object.keys(this.markerGuidMap).length) { + Object.keys(this.markerGuidMap).forEach((guid) => { + this.markerGuidMap[guid].destroyMarker(); + delete this.markerGuidMap[guid]; + }); + } + this.markerGuidMap = {}; if (this.chartOptions.markers && this.chartOptions.markers.length > 0) { - // delete all the old markers - if (Object.keys(this.markerGuidMap).length) { - Object.keys(this.markerGuidMap).forEach((guid) => { - this.markerGuidMap[guid].destroyMarker(); - delete this.markerGuidMap[guid]; - }); - } - this.markerGuidMap = {}; + this.chartOptions.markers.forEach((markerValueTuples, markerIndex) => { if (markerValueTuples === null || markerValueTuples === undefined) { return; @@ -2040,9 +2041,8 @@ class LineChart extends TemporalXAxisComponent { this.renderSeriesLabelsMarker(); - if (this.chartOptions.markers && this.chartOptions.markers.length > 0) { - this.importMarkers(); - } + this.importMarkers(); + d3.select("html").on("click." + Utils.guid(), () => { if (this.ellipsisContainer && d3.event.target != this.ellipsisContainer.select(".tsi-ellipsisButton").node()) {