@progress/kendo-charts 2.11.0 → 2.11.1-develop.2

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.
@@ -2405,6 +2405,17 @@ setDefaultOptions(Chart, {
2405
2405
  renderAs: "",
2406
2406
  motion: {},
2407
2407
  chartArea: {},
2408
+ axisDefaults: {
2409
+ categoryAxis: {
2410
+ highlight: {
2411
+ visible: false,
2412
+ border: null
2413
+ }
2414
+ },
2415
+ valueAxis: {
2416
+ narrowRange: false
2417
+ }
2418
+ },
2408
2419
  legend: {
2409
2420
  visible: true,
2410
2421
  labels: {},
@@ -2417,12 +2428,7 @@ setDefaultOptions(Chart, {
2417
2428
  }
2418
2429
  }
2419
2430
  },
2420
- categoryAxis: {
2421
- highlight: {
2422
- visible: false,
2423
- border: null
2424
- }
2425
- },
2431
+ categoryAxis: {},
2426
2432
  seriesDefaults: {
2427
2433
  type: COLUMN,
2428
2434
  data: [],
@@ -2449,9 +2455,7 @@ setDefaultOptions(Chart, {
2449
2455
  },
2450
2456
  transitions: true,
2451
2457
  observeStyles: false,
2452
- valueAxis: {
2453
- narrowRange: false
2454
- },
2458
+ valueAxis: {},
2455
2459
  plotArea: {},
2456
2460
  title: {},
2457
2461
  xAxis: {},
@@ -344,28 +344,53 @@ class PlotAreaBase extends ChartElement {
344
344
  const unclipBox = pane.unclipBox();
345
345
  const clipBox = pane.chartContainer._clipBox();
346
346
  const padding = getSpacing(pane.options.padding || {});
347
-
348
- if (unclipBox.y1 < clipBox.y1 + padding.top) {
349
- change = true;
350
- padding.top = clipBox.y1 - unclipBox.y1 + padding.top;
347
+ const paneWidth = clipBox.width() + padding.left + padding.right;
348
+ const paneHeight = clipBox.height() + padding.top + padding.bottom;
349
+ const maxCorrectionFactor = 0.2;
350
+ let paneChange = false;
351
+
352
+ if (unclipBox.y1 < clipBox.y1 - padding.top) {
353
+ const top = clipBox.y1 - unclipBox.y1;
354
+ const maxTop = paneHeight * maxCorrectionFactor;
355
+
356
+ if (top <= maxTop && top > padding.top) {
357
+ paneChange = true;
358
+ padding.top = top;
359
+ }
351
360
  }
352
361
 
353
- if (unclipBox.y2 > clipBox.y2 - padding.bottom) {
354
- change = true;
355
- padding.bottom = unclipBox.y2 - clipBox.y2 + padding.bottom;
362
+ if (unclipBox.y2 > clipBox.y2 + padding.bottom) {
363
+ const bottom = unclipBox.y2 - clipBox.y2;
364
+ const maxBottom = paneHeight * maxCorrectionFactor;
365
+
366
+ if (bottom <= maxBottom && bottom > padding.bottom) {
367
+ paneChange = true;
368
+ padding.bottom = bottom;
369
+ }
356
370
  }
357
371
 
358
- if (unclipBox.x1 < clipBox.x1 + padding.left) {
359
- change = true;
360
- padding.left = clipBox.x1 - unclipBox.x1 + padding.left;
372
+ if (unclipBox.x1 < clipBox.x1 - padding.left) {
373
+ const left = clipBox.x1 - unclipBox.x1;
374
+ const maxLeft = paneWidth * maxCorrectionFactor;
375
+
376
+ if (left <= maxLeft && left > padding.left) {
377
+ paneChange = true;
378
+ padding.left = left;
379
+ }
361
380
  }
362
381
 
363
- if (unclipBox.x2 > clipBox.x2 - padding.right) {
364
- change = true;
365
- padding.right = unclipBox.x2 - clipBox.x2 + padding.right;
382
+ if (unclipBox.x2 > clipBox.x2 + padding.right) {
383
+ const right = unclipBox.x2 - clipBox.x2;
384
+ const maxRight = paneWidth * maxCorrectionFactor;
385
+
386
+ if (right <= maxRight && right > padding.right) {
387
+ paneChange = true;
388
+ padding.right = right;
389
+ }
366
390
  }
367
391
 
368
- if (change) {
392
+ if (paneChange) {
393
+ change = true;
369
394
  pane.options.padding = padding;
370
395
  }
371
396
  });
@@ -2405,6 +2405,17 @@ setDefaultOptions(Chart, {
2405
2405
  renderAs: "",
2406
2406
  motion: {},
2407
2407
  chartArea: {},
2408
+ axisDefaults: {
2409
+ categoryAxis: {
2410
+ highlight: {
2411
+ visible: false,
2412
+ border: null
2413
+ }
2414
+ },
2415
+ valueAxis: {
2416
+ narrowRange: false
2417
+ }
2418
+ },
2408
2419
  legend: {
2409
2420
  visible: true,
2410
2421
  labels: {},
@@ -2417,12 +2428,7 @@ setDefaultOptions(Chart, {
2417
2428
  }
2418
2429
  }
2419
2430
  },
2420
- categoryAxis: {
2421
- highlight: {
2422
- visible: false,
2423
- border: null
2424
- }
2425
- },
2431
+ categoryAxis: {},
2426
2432
  seriesDefaults: {
2427
2433
  type: COLUMN,
2428
2434
  data: [],
@@ -2449,9 +2455,7 @@ setDefaultOptions(Chart, {
2449
2455
  },
2450
2456
  transitions: true,
2451
2457
  observeStyles: false,
2452
- valueAxis: {
2453
- narrowRange: false
2454
- },
2458
+ valueAxis: {},
2455
2459
  plotArea: {},
2456
2460
  title: {},
2457
2461
  xAxis: {},
@@ -344,28 +344,53 @@ class PlotAreaBase extends ChartElement {
344
344
  const unclipBox = pane.unclipBox();
345
345
  const clipBox = pane.chartContainer._clipBox();
346
346
  const padding = getSpacing(pane.options.padding || {});
347
-
348
- if (unclipBox.y1 < clipBox.y1 + padding.top) {
349
- change = true;
350
- padding.top = clipBox.y1 - unclipBox.y1 + padding.top;
347
+ const paneWidth = clipBox.width() + padding.left + padding.right;
348
+ const paneHeight = clipBox.height() + padding.top + padding.bottom;
349
+ const maxCorrectionFactor = 0.2;
350
+ let paneChange = false;
351
+
352
+ if (unclipBox.y1 < clipBox.y1 - padding.top) {
353
+ const top = clipBox.y1 - unclipBox.y1;
354
+ const maxTop = paneHeight * maxCorrectionFactor;
355
+
356
+ if (top <= maxTop && top > padding.top) {
357
+ paneChange = true;
358
+ padding.top = top;
359
+ }
351
360
  }
352
361
 
353
- if (unclipBox.y2 > clipBox.y2 - padding.bottom) {
354
- change = true;
355
- padding.bottom = unclipBox.y2 - clipBox.y2 + padding.bottom;
362
+ if (unclipBox.y2 > clipBox.y2 + padding.bottom) {
363
+ const bottom = unclipBox.y2 - clipBox.y2;
364
+ const maxBottom = paneHeight * maxCorrectionFactor;
365
+
366
+ if (bottom <= maxBottom && bottom > padding.bottom) {
367
+ paneChange = true;
368
+ padding.bottom = bottom;
369
+ }
356
370
  }
357
371
 
358
- if (unclipBox.x1 < clipBox.x1 + padding.left) {
359
- change = true;
360
- padding.left = clipBox.x1 - unclipBox.x1 + padding.left;
372
+ if (unclipBox.x1 < clipBox.x1 - padding.left) {
373
+ const left = clipBox.x1 - unclipBox.x1;
374
+ const maxLeft = paneWidth * maxCorrectionFactor;
375
+
376
+ if (left <= maxLeft && left > padding.left) {
377
+ paneChange = true;
378
+ padding.left = left;
379
+ }
361
380
  }
362
381
 
363
- if (unclipBox.x2 > clipBox.x2 - padding.right) {
364
- change = true;
365
- padding.right = unclipBox.x2 - clipBox.x2 + padding.right;
382
+ if (unclipBox.x2 > clipBox.x2 + padding.right) {
383
+ const right = unclipBox.x2 - clipBox.x2;
384
+ const maxRight = paneWidth * maxCorrectionFactor;
385
+
386
+ if (right <= maxRight && right > padding.right) {
387
+ paneChange = true;
388
+ padding.right = right;
389
+ }
366
390
  }
367
391
 
368
- if (change) {
392
+ if (paneChange) {
393
+ change = true;
369
394
  pane.options.padding = padding;
370
395
  }
371
396
  });