@bizdoc/core 1.13.0-next.1 → 1.13.0-next.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.
@@ -14729,7 +14729,7 @@ class CubeMatrixComponent {
14729
14729
  this.refresh();
14730
14730
  }
14731
14731
  _addindices() {
14732
- const collection = this.indexAt === 'series' ? this.rows : this.columns;
14732
+ const collection = this.indexAt === 'xAxis' ? this.columns : this.rows;
14733
14733
  this.indices.forEach((x, i) => {
14734
14734
  const header = {
14735
14735
  key: x.name,
@@ -14737,10 +14737,10 @@ class CubeMatrixComponent {
14737
14737
  index: x,
14738
14738
  accumulate: x.accumulate
14739
14739
  };
14740
- if (this.placeAt === 'leading')
14741
- collection.splice(i, 0, header);
14742
- else
14740
+ if (this.placeAt === 'trailing')
14743
14741
  collection.push(header);
14742
+ else
14743
+ collection.splice(i, 0, header);
14744
14744
  });
14745
14745
  }
14746
14746
  _addsumheaders() {
@@ -14806,17 +14806,17 @@ class CubeMatrixComponent {
14806
14806
  const d = {};
14807
14807
  series.forEach(s => {
14808
14808
  if (s.index) {
14809
- if (this.indexAt === 'series') {
14810
- const row = d[s.index] = {};
14811
- s.points.forEach(p => row[p.x] = p.y);
14812
- }
14813
- else
14809
+ if (this.indexAt === 'xAxis')
14814
14810
  s.points.forEach(p => {
14815
14811
  let row = d[p.x];
14816
14812
  if (!row)
14817
14813
  row = d[p.x] = {};
14818
14814
  row[s.index] = p.y;
14819
14815
  });
14816
+ else {
14817
+ const row = d[s.index] = {};
14818
+ s.points.forEach(p => row[p.x] = p.y);
14819
+ }
14820
14820
  }
14821
14821
  else {
14822
14822
  const row = d[s.name] = {};
@@ -14839,20 +14839,20 @@ class CubeMatrixComponent {
14839
14839
  this.rows.forEach(r => {
14840
14840
  const datarow = data[r.key];
14841
14841
  if (datarow) {
14842
- let sum = 0;
14842
+ let columnTotal = 0;
14843
14843
  this.columns.forEach(c => {
14844
14844
  if (c.accumulate === false || c.sum !== undefined)
14845
14845
  return;
14846
14846
  let val = datarow[c.key];
14847
14847
  if (val !== undefined)
14848
- sum += this.indices.length === 0 || this.indexAt === 'series' ||
14848
+ columnTotal += this.indices.length === 0 || this.indexAt !== 'xAxis' ||
14849
14849
  c.index !== undefined ? val : -val;
14850
14850
  });
14851
- datarow['_total'] = this._format(sum, r);
14851
+ datarow['_total'] = this._format(columnTotal, r);
14852
14852
  if (!r.sum)
14853
14853
  grand += this.indices.length === 0 ||
14854
14854
  this.indexAt === 'xAxis' ||
14855
- r.index !== undefined ? sum : -sum;
14855
+ r.index !== undefined ? columnTotal : -columnTotal;
14856
14856
  }
14857
14857
  else
14858
14858
  data[r.key] = {
@@ -14862,16 +14862,16 @@ class CubeMatrixComponent {
14862
14862
  const totals = data['_total'] = this.totals = {};
14863
14863
  totals['_grand'] = this._format(grand);
14864
14864
  this.columns.forEach(c => {
14865
- let sum = 0;
14865
+ let rowTotal = 0;
14866
14866
  this.rows.forEach(row => {
14867
14867
  if (row.accumulate === false || row.sum !== undefined)
14868
14868
  return;
14869
14869
  const val = data[row.key][c.key];
14870
14870
  if (val !== undefined)
14871
- sum += this.indices.length === 0 || this.indexAt === 'xAxis' ||
14871
+ rowTotal += this.indices.length === 0 || this.indexAt === 'xAxis' ||
14872
14872
  row.index !== undefined ? val : -val;
14873
14873
  });
14874
- totals[c.key] = this._format(sum, c);
14874
+ totals[c.key] = this._format(rowTotal, c);
14875
14875
  });
14876
14876
  }
14877
14877
  _calculatesum(data) {