You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/01/11 04:02:49 UTC

[incubator-echarts] 01/01: fix(data): fix wrong data fetch when appendData with TypedArray

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch fix-appendData-typedarray
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 03c823a98c2537c8c397a54cf4bb30b6b7eccc69
Author: pissang <bm...@gmail.com>
AuthorDate: Mon Jan 11 12:01:49 2021 +0800

    fix(data): fix wrong data fetch when appendData with TypedArray
---
 src/data/helper/dataProvider.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/data/helper/dataProvider.ts b/src/data/helper/dataProvider.ts
index 412f69e..6135a9d 100644
--- a/src/data/helper/dataProvider.ts
+++ b/src/data/helper/dataProvider.ts
@@ -201,7 +201,8 @@ export class DefaultDataProvider implements DataProvider {
                 const count = end - start;
                 const arr = storage[dim];
                 for (let i = 0; i < count; i++) {
-                    const val = data[(start + i) * dimSize + dim];
+                    // appendData with TypedArray will always do replace in provider.
+                    const val = data[i * dimSize + dim];
                     arr[start + i] = val;
                     val < min && (min = val);
                     val > max && (max = val);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org