@progress/kendo-charts 2.13.0-develop.1 → 2.13.0-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.
- package/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/chart/plotarea/categorical-plotarea.js +9 -6
- package/dist/es2015/chart/plotarea/categorical-plotarea.js +9 -6
- package/dist/npm/main.js +11 -6
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +1 -1
|
@@ -131,7 +131,8 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
131
131
|
this._seriesPointsCache = {};
|
|
132
132
|
this._currentPointsCache = {};
|
|
133
133
|
categoryAxis.options.dataItems = [];
|
|
134
|
-
|
|
134
|
+
|
|
135
|
+
series = this.aggregateSeries(series, categoryAxis);
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
const min = range ? range.min : 0;
|
|
@@ -304,7 +305,7 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
304
305
|
return result;
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
aggregateSeries(series, categoryAxis, range) {
|
|
308
|
+
aggregateSeries(series, categoryAxis, range = null) {
|
|
308
309
|
const srcData = series.data;
|
|
309
310
|
if (!srcData.length) {
|
|
310
311
|
return series;
|
|
@@ -314,11 +315,13 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
314
315
|
const result = deepExtend({}, series);
|
|
315
316
|
const aggregator = new SeriesAggregator(deepExtend({}, series), SeriesBinder.current, DefaultAggregates.current);
|
|
316
317
|
const data = result.data = [];
|
|
317
|
-
|
|
318
318
|
const dataItems = categoryAxis.options.dataItems || [];
|
|
319
319
|
|
|
320
|
+
// Use full range if not provided, otherwise use current range to aggregate only visible categories
|
|
321
|
+
const aggregateRange = range || { min: 0, max: srcPoints.length - 1 };
|
|
322
|
+
|
|
320
323
|
const categoryItem = (idx) => {
|
|
321
|
-
const categoryIdx = idx -
|
|
324
|
+
const categoryIdx = idx - aggregateRange.min;
|
|
322
325
|
let point = srcPoints[idx];
|
|
323
326
|
if (!point) {
|
|
324
327
|
point = srcPoints[idx] = {};
|
|
@@ -335,7 +338,7 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
335
338
|
return point;
|
|
336
339
|
};
|
|
337
340
|
|
|
338
|
-
for (let idx =
|
|
341
|
+
for (let idx = aggregateRange.min; idx <= aggregateRange.max; idx++) {
|
|
339
342
|
const point = categoryItem(idx);
|
|
340
343
|
data[point.categoryIx] = point.item;
|
|
341
344
|
|
|
@@ -345,7 +348,7 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
345
348
|
}
|
|
346
349
|
|
|
347
350
|
if (inArray(result.type, OUT_OF_RANGE_SERIES)) {
|
|
348
|
-
createOutOfRangePoints(result,
|
|
351
|
+
createOutOfRangePoints(result, aggregateRange, categoryAxis.totalCount(), categoryItem, (idx) => srcPoints[idx]);
|
|
349
352
|
}
|
|
350
353
|
|
|
351
354
|
categoryAxis.options.dataItems = dataItems;
|
|
@@ -131,7 +131,8 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
131
131
|
this._seriesPointsCache = {};
|
|
132
132
|
this._currentPointsCache = {};
|
|
133
133
|
categoryAxis.options.dataItems = [];
|
|
134
|
-
|
|
134
|
+
|
|
135
|
+
series = this.aggregateSeries(series, categoryAxis);
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
const min = range ? range.min : 0;
|
|
@@ -304,7 +305,7 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
304
305
|
return result;
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
aggregateSeries(series, categoryAxis, range) {
|
|
308
|
+
aggregateSeries(series, categoryAxis, range = null) {
|
|
308
309
|
const srcData = series.data;
|
|
309
310
|
if (!srcData.length) {
|
|
310
311
|
return series;
|
|
@@ -314,11 +315,13 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
314
315
|
const result = deepExtend({}, series);
|
|
315
316
|
const aggregator = new SeriesAggregator(deepExtend({}, series), SeriesBinder.current, DefaultAggregates.current);
|
|
316
317
|
const data = result.data = [];
|
|
317
|
-
|
|
318
318
|
const dataItems = categoryAxis.options.dataItems || [];
|
|
319
319
|
|
|
320
|
+
// Use full range if not provided, otherwise use current range to aggregate only visible categories
|
|
321
|
+
const aggregateRange = range || { min: 0, max: srcPoints.length - 1 };
|
|
322
|
+
|
|
320
323
|
const categoryItem = (idx) => {
|
|
321
|
-
const categoryIdx = idx -
|
|
324
|
+
const categoryIdx = idx - aggregateRange.min;
|
|
322
325
|
let point = srcPoints[idx];
|
|
323
326
|
if (!point) {
|
|
324
327
|
point = srcPoints[idx] = {};
|
|
@@ -335,7 +338,7 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
335
338
|
return point;
|
|
336
339
|
};
|
|
337
340
|
|
|
338
|
-
for (let idx =
|
|
341
|
+
for (let idx = aggregateRange.min; idx <= aggregateRange.max; idx++) {
|
|
339
342
|
const point = categoryItem(idx);
|
|
340
343
|
data[point.categoryIx] = point.item;
|
|
341
344
|
|
|
@@ -345,7 +348,7 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
345
348
|
}
|
|
346
349
|
|
|
347
350
|
if (inArray(result.type, OUT_OF_RANGE_SERIES)) {
|
|
348
|
-
createOutOfRangePoints(result,
|
|
351
|
+
createOutOfRangePoints(result, aggregateRange, categoryAxis.totalCount(), categoryItem, (idx) => srcPoints[idx]);
|
|
349
352
|
}
|
|
350
353
|
|
|
351
354
|
categoryAxis.options.dataItems = dataItems;
|