@evergis/charts 2.0.92 → 2.0.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,7 @@ export interface BarChartMarker {
25
25
  value: number;
26
26
  color?: string;
27
27
  className?: string;
28
+ horizontal?: boolean;
28
29
  }
29
30
  export declare type BarChartProps = {
30
31
  className?: string;
@@ -2760,6 +2760,12 @@ const draw$4 = (node, props) => {
2760
2760
  return;
2761
2761
  }
2762
2762
 
2763
+ if (marker.horizontal) {
2764
+ svg.append('line').style("stroke", marker.color || "inherit").style("stroke-width", 1).style("stroke-dasharray", "5, 3").attr("x1", marginLeft + yAxisWidth).attr("y1", yScale(marker.value) + 1).attr("x2", width).attr("y2", yScale(marker.value) + 1);
2765
+ svg.append("text").attr("y", yScale(marker.value) + 1).attr("x", marginLeft + yAxisWidth).attr('text-anchor', 'middle').attr("class", ["marker", marker.className].filter(Boolean).join(" ")).style("fill", (marker == null ? void 0 : marker.color) || "inherit").text(marker.label);
2766
+ return;
2767
+ }
2768
+
2763
2769
  svg.append('line').style("stroke", marker.color || "inherit").style("stroke-width", 1).style("stroke-dasharray", "5, 3").attr("x1", width / data.length * marker.value + 1).attr("y1", 0).attr("x2", width / data.length * marker.value + 1).attr("y2", height - marginTop - marginBottom + marginBottom / 2);
2764
2770
  svg.append("text").attr("y", height).attr("x", width / data.length * marker.value + 1).attr('text-anchor', 'middle').attr("class", ["marker", marker.className].filter(Boolean).join(" ")).style("fill", (marker == null ? void 0 : marker.color) || "inherit").text(marker.label);
2765
2771
  });