@opendata-ai/openchart-engine 2.11.0 → 2.12.1

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.
package/dist/index.js CHANGED
@@ -238,7 +238,7 @@ function resolveRangeAnnotation(annotation, scales, chartArea, isDark) {
238
238
  const rect = { x: x2, y: y2, width, height };
239
239
  let label;
240
240
  if (annotation.label) {
241
- const anchor = annotation.labelAnchor ?? "left";
241
+ const anchor = annotation.labelAnchor ?? "top";
242
242
  const centered = anchor === "top" || anchor === "bottom" || anchor === "auto";
243
243
  const baseDx = centered ? 0 : anchor === "right" ? -4 : 4;
244
244
  const baseDy = 14;
@@ -7501,6 +7501,9 @@ function buildFields(row, encoding, color2) {
7501
7501
  return fields;
7502
7502
  }
7503
7503
  function getTooltipTitle(row, encoding) {
7504
+ if (encoding.detail) {
7505
+ return String(row[encoding.detail.field] ?? "");
7506
+ }
7504
7507
  if (encoding.x?.type === "temporal") {
7505
7508
  return formatValue(row[encoding.x.field], "temporal");
7506
7509
  }