cx 24.10.8 → 24.10.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cx",
3
- "version": "24.10.8",
3
+ "version": "24.10.9",
4
4
  "description": "Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.",
5
5
  "main": "index.js",
6
6
  "jsnext:main": "src/index.js",
@@ -344,4 +344,8 @@ class NumericScale {
344
344
  for (let i = start; i <= end; i++) result.push(this.map(i * size));
345
345
  return result;
346
346
  }
347
+
348
+ book() {
349
+ Console.warn("NumericAxis does not support the autoSize flag for column and bar graphs.");
350
+ }
347
351
  }
@@ -4,6 +4,7 @@ import { Stack } from "./Stack";
4
4
  import { Format } from "../../ui/Format";
5
5
  import { isNumber } from "../../util/isNumber";
6
6
  import { zeroTime } from "../../util/date/zeroTime";
7
+ import { Console } from "../../util/Console";
7
8
 
8
9
  Format.registerFactory("yearOrMonth", (format) => {
9
10
  let year = Format.parse("datetime;yyyy");
@@ -511,6 +512,9 @@ class TimeScale {
511
512
  break;
512
513
  }
513
514
 
515
+ if (lowerTickUnit && this.minTickUnit && miliSeconds[lowerTickUnit] < miliSeconds[this.minTickUnit])
516
+ lowerTickUnit = this.minTickUnit == this.tickMeasure ? null : this.minTickUnit;
517
+
514
518
  if (lowerTickUnit != null && this.scale) {
515
519
  let bestMinorTickSize = Infinity;
516
520
  let divisions = this.tickDivisions[lowerTickUnit];
@@ -534,7 +538,7 @@ class TimeScale {
534
538
  }
535
539
  }
536
540
 
537
- if (isNumber(this.snapToTicks) && this.snapToTicks >= 0) {
541
+ if (isNumber(this.snapToTicks) && this.snapToTicks >= 0 && this.tickSizes.length > 0) {
538
542
  let tickSize = this.tickSizes[Math.min(this.tickSizes.length - 1, this.snapToTicks)];
539
543
  this.scale = this.getScale(tickSize.size, tickSize.measure, minRange);
540
544
  }
@@ -567,6 +571,7 @@ class TimeScale {
567
571
  minDate = new Date(this.scale.min - this.scale.minPadding);
568
572
  maxDate = new Date(this.scale.max + this.scale.maxPadding);
569
573
  let date = zeroTime(minDate);
574
+ while (date.getTime() < minDate.getTime()) date.setDate(date.getDate() + 1);
570
575
  if (measure == "week") {
571
576
  //start on monday
572
577
  while (date.getDay() != 1) {
@@ -598,4 +603,8 @@ class TimeScale {
598
603
  if (this.tickSizes.length == 0) return [];
599
604
  return this.getTicks([this.tickSizes[0]])[0].map((x) => this.map(x));
600
605
  }
606
+
607
+ book() {
608
+ Console.warn("TimeAxis does not support the autoSize flag for column and bar graphs.");
609
+ }
601
610
  }