cx 24.10.10 → 24.10.11

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/charts.js CHANGED
@@ -4614,6 +4614,7 @@ var CategoryAxis = /*#__PURE__*/ (function (_Axis) {
4614
4614
  values: undefined,
4615
4615
  minSize: undefined,
4616
4616
  categoryCount: undefined,
4617
+ format: undefined,
4617
4618
  },
4618
4619
  ]),
4619
4620
  );
@@ -4638,15 +4639,23 @@ var CategoryAxis = /*#__PURE__*/ (function (_Axis) {
4638
4639
  var data = instance.data,
4639
4640
  calculator = instance.calculator;
4640
4641
  if (!data.bounds.valid()) return null;
4641
- var formatter = function formatter(v) {
4642
- return calculator.names[v] || v;
4642
+ var labelGetter = function labelGetter(v) {
4643
+ var _calculator$names$v;
4644
+ return (_calculator$names$v = calculator.names[v]) != null ? _calculator$names$v : v;
4643
4645
  };
4646
+ var labelFormatter = labelGetter;
4647
+ if (data.format) {
4648
+ var formatter = Format.parse(data.format);
4649
+ labelFormatter = function labelFormatter(v) {
4650
+ return formatter(labelGetter(v));
4651
+ };
4652
+ }
4644
4653
  return /*#__PURE__*/ jsx(
4645
4654
  "g",
4646
4655
  {
4647
4656
  className: data.classNames,
4648
4657
  style: data.style,
4649
- children: this.renderTicksAndLabels(context, instance, formatter),
4658
+ children: this.renderTicksAndLabels(context, instance, labelFormatter),
4650
4659
  },
4651
4660
  key,
4652
4661
  );