You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2019/12/22 09:21:57 UTC

[GitHub] [incubator-echarts] karma2014 opened a new pull request #11892: fix(pie): Process series data-Array . close #11247

karma2014 opened a new pull request #11892: fix(pie): Process series data-Array . close #11247
URL: https://github.com/apache/incubator-echarts/pull/11892
 
 
   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [ ] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   <!-- USE ONCE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   
   
   ### Fixed issues
   
   <!--
   - #xxxx: ...
   -->
   
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ### After: How is it fixed in this PR?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ## Usage
   
   ### Are there any API changes?
   
   - [ ] The API has been changed.
   
   <!-- LIST THE API CHANGES HERE -->
   
   
   
   ### Related test cases or examples to use the new APIs
   
   NA.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merge.
   
   ### Other information
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] pissang commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247
URL: https://github.com/apache/incubator-echarts/pull/11892#discussion_r361887884
 
 

 ##########
 File path: src/chart/pie/pieLayout.js
 ##########
 @@ -68,7 +68,40 @@ export default function (seriesType, ecModel, api, payload) {
             !isNaN(value) && validDataCount++;
         });
 
-        var sum = data.getSum(valueDim);
+        var sum = 0;
+        var max = data._rawExtent[1];   
+        var tempMax = 0;                
+        var trueValueArray = [];        
+        var extent = data.getDataExtent(valueDim);
+
+        if(data && data._rawData && data._rawData._data && data._rawData._data.length && data._rawData._data.length > 0){
 
 Review comment:
   Property with `_` prefix is private. Please do not access them outside.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] karma2014 commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247

Posted by GitBox <gi...@apache.org>.
karma2014 commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247
URL: https://github.com/apache/incubator-echarts/pull/11892#discussion_r360920946
 
 

 ##########
 File path: src/chart/pie/PieSeries.js
 ##########
 @@ -45,6 +48,28 @@ var PieSeries = echarts.extendSeriesModel({
         this._defaultLabelLine(option);
     },
 
+    processOptionSeriesValue: function (option) {
+        var data = option.data;
+
+        for(var i = 0; i < data.length; i++){
+            if(data[i].value instanceof Array){
+                //visualMap component fix me
+                // if(data[i].value[0] instanceof Array){
 
 Review comment:
   My answer is incorrect.I am trying to fix it.I want sum array value before compute each Sector ‘s area,please wait for my resubmit.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] karma2014 closed pull request #11892: fix(pie): Process series data-Array . close #11247

Posted by GitBox <gi...@apache.org>.
karma2014 closed pull request #11892: fix(pie): Process series data-Array . close #11247
URL: https://github.com/apache/incubator-echarts/pull/11892
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] karma2014 commented on issue #11892: fix(pie): Process series data-Array . close #11247

Posted by GitBox <gi...@apache.org>.
karma2014 commented on issue #11892: fix(pie): Process series data-Array . close #11247
URL: https://github.com/apache/incubator-echarts/pull/11892#issuecomment-569393197
 
 
   My first commit is not correct,so I resubmit to fix #11247 to support pie chart series.data to process Array  data. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] pissang commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247
URL: https://github.com/apache/incubator-echarts/pull/11892#discussion_r360714473
 
 

 ##########
 File path: src/chart/pie/PieSeries.js
 ##########
 @@ -45,6 +48,28 @@ var PieSeries = echarts.extendSeriesModel({
         this._defaultLabelLine(option);
     },
 
+    processOptionSeriesValue: function (option) {
+        var data = option.data;
+
+        for(var i = 0; i < data.length; i++){
+            if(data[i].value instanceof Array){
+                //visualMap component fix me
+                // if(data[i].value[0] instanceof Array){
 
 Review comment:
   What's this commented code about?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] karma2014 commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247

Posted by GitBox <gi...@apache.org>.
karma2014 commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247
URL: https://github.com/apache/incubator-echarts/pull/11892#discussion_r360921513
 
 

 ##########
 File path: src/chart/pie/PieSeries.js
 ##########
 @@ -45,6 +48,28 @@ var PieSeries = echarts.extendSeriesModel({
         this._defaultLabelLine(option);
     },
 
+    processOptionSeriesValue: function (option) {
+        var data = option.data;
+
+        for(var i = 0; i < data.length; i++){
+            if(data[i].value instanceof Array){
+                //visualMap component fix me
+                // if(data[i].value[0] instanceof Array){
+                //     if(option.visualMap && option.visualMap instanceof Array){
+                //         for(var j = 0; j < option.visualMap.length; j++){
+                //             option.visualMap[j]['value'] = data[i].value[j][1]; //set second number to visualMap...
+                //         }
+                //     }
+                // }
+                data[i].value = data[i].value.reduce(function(a, b) {
 
 Review comment:
   Thanks for the reminder, I am try to fix.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-echarts] pissang commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #11892: fix(pie): Process series data-Array . close #11247
URL: https://github.com/apache/incubator-echarts/pull/11892#discussion_r360714330
 
 

 ##########
 File path: src/chart/pie/PieSeries.js
 ##########
 @@ -45,6 +48,28 @@ var PieSeries = echarts.extendSeriesModel({
         this._defaultLabelLine(option);
     },
 
+    processOptionSeriesValue: function (option) {
+        var data = option.data;
+
+        for(var i = 0; i < data.length; i++){
+            if(data[i].value instanceof Array){
+                //visualMap component fix me
+                // if(data[i].value[0] instanceof Array){
+                //     if(option.visualMap && option.visualMap instanceof Array){
+                //         for(var j = 0; j < option.visualMap.length; j++){
+                //             option.visualMap[j]['value'] = data[i].value[j][1]; //set second number to visualMap...
+                //         }
+                //     }
+                // }
+                data[i].value = data[i].value.reduce(function(a, b) {
 
 Review comment:
   Please do not use `reduce` function. It's not compatitable in IE8

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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