
export default function (seriesType, defaultSymbolType, legendSymbol) {
    // Encoding visual for all series include which is filtered for legend drawing
    return {
        seriesType: seriesType,
        processRawSeries: true,
        reset: function (seriesModel, ecModel, api) {
            var data = seriesModel.getData();

            var symbolType = seriesModel.get('symbol') || defaultSymbolType;
            var symbolSize = seriesModel.get('symbolSize');

            data.setVisual({
                legendSymbol: legendSymbol || symbolType,
                symbol: symbolType,
                symbolSize: symbolSize
            });

            // Only visible series has each data be visual encoded
            if (ecModel.isSeriesFiltered(seriesModel)) {
                return;
            }

            function dataEach(data, idx) {
                if (typeof symbolSize === 'function') {
                    var rawValue = seriesModel.getRawValue(idx);
                    // FIXME
                    var params = seriesModel.getDataParams(idx);
                    data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));
                }

                var itemModel = data.getItemModel(idx);
                var itemSymbolType = itemModel.getShallow('symbol', true);
                var itemSymbolSize = itemModel.getShallow('symbolSize', true);
                // If has item symbol
                if (itemSymbolType != null) {
                    data.setItemVisual(idx, 'symbol', itemSymbolType);
                }
                if (itemSymbolSize != null) {
                    // PENDING Transform symbolSize ?
                    data.setItemVisual(idx, 'symbolSize', itemSymbolSize);
                }
            }

            return { dataEach: data.hasItemOption ? dataEach : null };
        }
    };
}

// export default function (seriesType, defaultSymbolType, legendSymbol, ecModel) {
//     // Encoding visual for all series include which is filtered for legend drawing
//     ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {
//         seriesModel.pipeTask(
//             createTask(seriesModel, defaultSymbolType, legendSymbol, ecModel),
//             'visual'
//         );
//     });
// }

// function createTask(seriesModel, defaultSymbolType, legendSymbol, ecModel) {
//     var data = seriesModel.getData();

//     var symbolType = seriesModel.get('symbol') || defaultSymbolType;
//     var symbolSize = seriesModel.get('symbolSize');

//     data.setVisual({
//         legendSymbol: legendSymbol || symbolType,
//         symbol: symbolType,
//         symbolSize: symbolSize
//     });

//     // Only visible series has each data be visual encoded
//     if (ecModel.isSeriesFiltered(seriesModel)) {
//         return;
//     }

//     return data.createEachTask(function (idx) {
//         if (typeof symbolSize === 'function') {
//             var rawValue = seriesModel.getRawValue(idx);
//             // FIXME
//             var params = seriesModel.getDataParams(idx);
//             data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));
//         }

//         var itemModel = data.getItemModel(idx);
//         var itemSymbolType = itemModel.getShallow('symbol', true);
//         var itemSymbolSize = itemModel.getShallow('symbolSize', true);
//         // If has item symbol
//         if (itemSymbolType != null) {
//             data.setItemVisual(idx, 'symbol', itemSymbolType);
//         }
//         if (itemSymbolSize != null) {
//             // PENDING Transform symbolSize ?
//             data.setItemVisual(idx, 'symbolSize', itemSymbolSize);
//         }
//     });
// }

@@ -799,32 +799,97 @@
 %0A            %7D%0A%0A
+            var hasCallback = typeof symbolSize === 'function';%0A%0A
             func
@@ -1230,32 +1230,78 @@
              %7D%0A%0A
+                if (data.hasItemOption) %7B%0A    
                 
@@ -1348,32 +1348,36 @@
                 
+    
 var itemSymbolTy
@@ -1411,32 +1411,36 @@
 symbol', true);%0A
+    
                 
@@ -1510,32 +1510,36 @@
                 
+    
 // If has item s
@@ -1552,32 +1552,36 @@
                 
+   
+ 
 if (itemSymbolTy
@@ -1586,32 +1586,36 @@
 Type != null) %7B%0A
+    
                 
@@ -1677,34 +1677,42 @@
                 
+   
+ 
 %7D%0A
+    
                 
@@ -1753,32 +1753,36 @@
                 
+  
+  
 // PENDING Trans
@@ -1799,16 +1799,20 @@
 lSize ?%0A
+    
         
@@ -1874,24 +1874,46 @@
 ymbolSize);%0A
+                    %7D%0A
             
@@ -1964,16 +1964,17 @@
 taEach: 
+(
 data.has
@@ -1983,16 +1983,32 @@
 emOption
+ %7C%7C hasCallback)
  ? dataE

Fix callback symbolSize wrong bug.