|  | 
 | <!-- | 
 | Licensed to the Apache Software Foundation (ASF) under one | 
 | or more contributor license agreements.  See the NOTICE file | 
 | distributed with this work for additional information | 
 | regarding copyright ownership.  The ASF licenses this file | 
 | to you under the Apache License, Version 2.0 (the | 
 | "License"); you may not use this file except in compliance | 
 | with the License.  You may obtain a copy of the License at | 
 |  | 
 |    http://www.apache.org/licenses/LICENSE-2.0 | 
 |  | 
 | Unless required by applicable law or agreed to in writing, | 
 | software distributed under the License is distributed on an | 
 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 
 | KIND, either express or implied.  See the License for the | 
 | specific language governing permissions and limitations | 
 | under the License. | 
 | --> | 
 |  | 
 | <html> | 
 |     <head> | 
 |         <meta charset="utf-8"> | 
 |         <script src="lib/simpleRequire.js"></script> | 
 |         <script src="lib/config.js"></script> | 
 |         <script src="lib/testHelper.js"></script> | 
 |         <meta name="viewport" content="width=device-width, initial-scale=1" /> | 
 |         <link rel="stylesheet" href="lib/reset.css" /> | 
 |     </head> | 
 |     <body> | 
 |         <style> | 
 |             h1 { | 
 |                 line-height: 60px; | 
 |                 height: 60px; | 
 |                 background: #ddd; | 
 |                 text-align: center; | 
 |                 font-weight: bold; | 
 |                 font-size: 14px; | 
 |             } | 
 |             .chart { | 
 |                 height: 500px; | 
 |             } | 
 |         </style> | 
 |  | 
 |  | 
 |         <h1>Profile</h1> | 
 |         <div class="chart" id="profile"></div> | 
 |         <h1>Histogram</h1> | 
 |         <div class="chart" id="histogram"></div> | 
 |         <h1>Profit</h1> | 
 |         <div class="chart" id="profit"></div> | 
 |         <h1>Error Chart (Cartesian Bar)</h1> | 
 |         <div class="chart" id="errorChart-cartesian-bar"></div> | 
 |         <h1>Error Chart (Cartesian Scatter)</h1> | 
 |         <div class="chart" id="errorChart-cartesian-scatter"></div> | 
 |         <h1>Bar layout</h1> | 
 |         <div class="chart" id="errorChart-cartesian-bar-multi"></div> | 
 |         <h1>Cartesian Polygon</h1> | 
 |         <div class="chart" id="cartesian-polygon"></div> | 
 |         <h1>Calendar | Path data | text</h1> | 
 |         <div class="chart" id="calendar"></div> | 
 |         <h1>Update animation: Text | Image | Path </h1> | 
 |         <div class="chart" id="text-image-update"></div> | 
 |         <h1>Polar Block</h1> | 
 |         <div class="chart" id="polar-block"></div> | 
 |         <h1>Diff group children by name (animation of number icon should be normal)</h1> | 
 |         <div class="chart" id="diff-children-by-name"></div> | 
 |         <h1>Custom Single Axis</h1> | 
 |         <div class="chart" id="custom-single-axis"></div> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 var data = []; | 
 |                 var dataCount = 10; | 
 |                 var startTime = +new Date(); | 
 |                 var categories = ['categoryA', 'categoryB', 'categoryC']; | 
 |                 var types = [ | 
 |                     {name: 'JS Heap', color: '#7b9ce1'}, | 
 |                     {name: 'Documents', color: '#bd6d6c'}, | 
 |                     {name: 'Nodes', color: '#75d874'}, | 
 |                     {name: 'Listeners', color: '#e0bc78'}, | 
 |                     {name: 'GPU Memory', color: '#dc77dc'}, | 
 |                     {name: 'GPU', color: '#72b362'} | 
 |                 ]; | 
 |  | 
 |                 var renderCount = 0; | 
 |                 // Generate mock data | 
 |                 function updateData() { | 
 |                     data = []; | 
 |                     echarts.util.each(categories, function (category, index) { | 
 |                         var baseTime = startTime; | 
 |                         for (var i = 0; i < dataCount; i++) { | 
 |                             var typeItem = types[Math.round(Math.random() * (types.length - 1))]; | 
 |                             var duration = Math.round(Math.random() * 10000); | 
 |                             var isEven = renderCount % 2 === 0; | 
 |                             data.push({ | 
 |                                 name: typeItem.name, | 
 |                                 value: [ | 
 |                                     index, | 
 |                                     baseTime, | 
 |                                     isEven ? (baseTime += duration) : NaN, | 
 |                                     duration | 
 |                                 ], | 
 |                                 itemStyle: { | 
 |                                     normal: { | 
 |                                         color: typeItem.color | 
 |                                     } | 
 |                                 } | 
 |                             }); | 
 |                             isEven && (baseTime += Math.round(Math.random() * 2000)); | 
 |                         } | 
 |                     }); | 
 |                     renderCount++; | 
 |                 } | 
 |  | 
 |                 updateData(); | 
 |  | 
 |                 console.log(JSON.stringify({ | 
 |                     startTime: startTime, | 
 |                     data: data | 
 |                 })); | 
 |  | 
 |                 function renderItem(params, api) { | 
 |                     var categoryIndex = api.value(0); | 
 |                     var start = api.coord([api.value(1), categoryIndex]); | 
 |                     var end = api.coord([api.value(2), categoryIndex]); | 
 |                     var height = api.size([0, 1])[1] * 0.6; | 
 |  | 
 |                     var rectShape = echarts.graphic.clipRectByRect({ | 
 |                         x: start[0], | 
 |                         y: start[1] - height / 2, | 
 |                         width: end[0] - start[0], | 
 |                         height: height | 
 |                     }, { | 
 |                         x: params.coordSys.x, | 
 |                         y: params.coordSys.y, | 
 |                         width: params.coordSys.width, | 
 |                         height: params.coordSys.height | 
 |                     }); | 
 |  | 
 |                     return rectShape && { | 
 |                         type: 'rect', | 
 |                         shape: rectShape, | 
 |                         style: api.style() | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 option = { | 
 |                     tooltip: { | 
 |                         formatter: function (params) { | 
 |                             return params.marker + params.name + ': ' + params.value[3] + ' ms'; | 
 |                         } | 
 |                     }, | 
 |                     title: { | 
 |                         text: 'Profile', | 
 |                         left: 'center' | 
 |                     }, | 
 |                     legend: { | 
 |                         data: ['bar', 'error'] | 
 |                     }, | 
 |                     dataZoom: [{ | 
 |                         type: 'slider', | 
 |                         filterMode: 'weakFilter', | 
 |                         showDataShadow: false, | 
 |                         top: 400, | 
 |                         height: 10, | 
 |                         borderColor: 'transparent', | 
 |                         backgroundColor: '#e2e2e2', | 
 |                         handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', // jshint ignore:line | 
 |                         handleSize: 20, | 
 |                         handleStyle: { | 
 |                             shadowBlur: 6, | 
 |                             shadowOffsetX: 1, | 
 |                             shadowOffsetY: 2, | 
 |                             shadowColor: '#aaa' | 
 |                         }, | 
 |                         labelFormatter: function (val) { | 
 |                             return (val - startTime).toFixed(0) + ' ms'; | 
 |                         } | 
 |                     }, { | 
 |                         type: 'inside', | 
 |                         filterMode: 'weakFilter' | 
 |                     }], | 
 |                     grid: { | 
 |                         height:300 | 
 |                     }, | 
 |                     xAxis: { | 
 |                         min: startTime, | 
 |                         scale: true, | 
 |                         axisLabel: { | 
 |                             formatter: function (val) { | 
 |                                 return (val - startTime) + ' ms'; | 
 |                             } | 
 |                         } | 
 |                     }, | 
 |                     yAxis: { | 
 |                         data: categories | 
 |                     }, | 
 |                     series: [{ | 
 |                         type: 'custom', | 
 |                         renderItem: renderItem, | 
 |                         itemStyle: { | 
 |                             normal: { | 
 |                                 opacity: 0.8 | 
 |                             } | 
 |                         }, | 
 |                         encode: { | 
 |                             x: [1, 2], | 
 |                             y: 0 | 
 |                         }, | 
 |                         data: data | 
 |                     }] | 
 |                 }; | 
 |  | 
 |                 var chart = testHelper.create(echarts, 'profile', { | 
 |                     option: option, | 
 |                     title: [ | 
 |                         'The data should be cleared when clicking the **updateData** button firstly', | 
 |                         'Should have no errors when clicking the **updateData** button once again' | 
 |                     ], | 
 |                     buttons: [ | 
 |                         { | 
 |                             text: 'updateData', | 
 |                             onclick: function () { | 
 |                                 updateData(); | 
 |                                 chart.setOption({ | 
 |                                     series: [{ | 
 |                                         data: data | 
 |                                     }] | 
 |                                 }); | 
 |                             } | 
 |                         } | 
 |                     ] | 
 |                 }); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 // See https://github.com/ecomfe/echarts-stat | 
 |                 // var bins = {"bins":[{"sample":[8.3,8.6,8.8],"x0":8,"x1":10},{"sample":[10.5,10.7,10.8,11,11,11.1,11.2,11.3,11.4,11.4,11.7],"x0":10,"x1":12},{"sample":[12,12.9,12.9,13.3,13.7,13.8],"x0":12,"x1":14},{"sample":[14,14.2,14.5],"x0":14,"x1":16},{"sample":[16,16.3,17.3,17.5,17.9],"x0":16,"x1":18},{"sample":[18,18],"x0":18,"x1":20},{"sample":[20.6],"x0":20,"x1":22}],"data":[[9,3],[11,11],[13,6],[15,3],[17,5],[19,2],[21,1]]}; | 
 |                 var bins = {"bins":[{"sample":[],"x0":0.5,"x1":1},{"sample":[1.4,1.4,1.3,1.4,1.4,1.4,1.4,1.1,1.2,1.3,1.4,1,1.4,1.4,1.2,1.3,1.4,1.3,1.3,1.3,1.3,1.4,1.4,1.4],"x0":1,"x1":1.5},{"sample":[1.5,1.7,1.5,1.5,1.5,1.6,1.5,1.7,1.5,1.7,1.5,1.7,1.9,1.6,1.6,1.5,1.6,1.6,1.5,1.5,1.5,1.5,1.6,1.9,1.6,1.5],"x0":1.5,"x1":2},{"sample":[],"x0":2,"x1":2.5},{"sample":[],"x0":2.5,"x1":3},{"sample":[3.3,3.3,3],"x0":3,"x1":3.5},{"sample":[3.9,3.5,3.6,3.9,3.5,3.8,3.7,3.9],"x0":3.5,"x1":4},{"sample":[4,4.2,4,4.4,4.1,4,4.3,4.4,4.4,4.1,4,4.4,4,4.2,4.2,4.2,4.3,4.1],"x0":4,"x1":4.5},{"sample":[4.7,4.5,4.9,4.6,4.5,4.7,4.6,4.7,4.5,4.5,4.8,4.9,4.7,4.8,4.5,4.5,4.5,4.7,4.6,4.5,4.9,4.9,4.8,4.9,4.8],"x0":4.5,"x1":5},{"sample":[5,5.1,5.1,5.1,5.3,5,5.1,5.3,5,5.1,5.4,5.1,5.1,5.2,5,5.2,5.4,5.1],"x0":5,"x1":5.5},{"sample":[5.9,5.6,5.8,5.8,5.5,5.5,5.7,5.7,5.6,5.8,5.6,5.6,5.6,5.5,5.6,5.9,5.7],"x0":5.5,"x1":6},{"sample":[6,6.3,6.1,6,6.1,6.4,6.1],"x0":6,"x1":6.5},{"sample":[6.6,6.7,6.9,6.7],"x0":6.5,"x1":7}],"data":[[0.75,0],[1.25,24],[1.75,26],[2.25,0],[2.75,0],[3.25,3],[3.75,8],[4.25,18],[4.75,25],[5.25,18],[5.75,17],[6.25,7],[6.75,4]]}; | 
 |                 var interval; | 
 |                 var min = Infinity; | 
 |                 var max = -Infinity; | 
 |                 data = echarts.util.map(bins.data, function (item, index) { | 
 |                     var x0 = bins.bins[index].x0; | 
 |                     var x1 = bins.bins[index].x1; | 
 |                     interval = x1 - x0; | 
 |                     min = Math.min(min, x0); | 
 |                     max = Math.max(max, x1); | 
 |                     return [x0, x1, item[1]]; | 
 |                 }); | 
 |  | 
 |                 function renderItem(params, api) { | 
 |                     var yValue = api.value(2); | 
 |                     var start = api.coord([api.value(0), yValue]); | 
 |                     var size = api.size([api.value(1) - api.value(0), yValue]); | 
 |                     var style = api.style(); | 
 |  | 
 |                     return { | 
 |                         type: 'rect', | 
 |                         shape: { | 
 |                             x: start[0] + 1, | 
 |                             y: start[1], | 
 |                             width: size[0] - 2, | 
 |                             height: size[1] | 
 |                         }, | 
 |                         style: style | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 var option = { | 
 |                     tooltip: { | 
 |                     }, | 
 |                     xAxis: { | 
 |                         interval: interval, | 
 |                         min: min, | 
 |                         max: max | 
 |                     }, | 
 |                     yAxis: { | 
 |                     }, | 
 |                     series: [{ | 
 |                         type: 'custom', | 
 |                         renderItem: renderItem, | 
 |                         label: { | 
 |                             normal: { | 
 |                                 show: true, | 
 |                                 position: 'top' | 
 |                             } | 
 |                         }, | 
 |                         encode: { | 
 |                             x: [0, 1], | 
 |                             y: 2, | 
 |                             tooltip: 2 | 
 |                         }, | 
 |                         data: data | 
 |                     }] | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'histogram', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 // var data = [[10, 16, 3], [16, 18, 15], [18, 26, 12], [26, 32, 22], [32, 56, 7], [56, 62, 17]]; | 
 |                 var data = [[10, 16, 3, 'A'], [16, 18, 15, 'B'], [18, 26, 12, 'C'], [26, 32, 22, 'D'], [32, 56, 7, 'E'], [56, 62, 17, 'F']]; | 
 |                 var colorList = ['#4f81bd', '#c0504d', '#9bbb59', '#604a7b', '#948a54', '#e46c0b']; | 
 |                 data = echarts.util.map(data, function (item, index) { | 
 |                     return { | 
 |                         value: item, | 
 |                         itemStyle: { | 
 |                             normal: { | 
 |                                 color: colorList[index] | 
 |                             } | 
 |                         } | 
 |                     }; | 
 |                 }); | 
 |  | 
 |                 function renderItem(params, api) { | 
 |                     var yValue = api.value(2); | 
 |                     var start = api.coord([api.value(0), yValue]); | 
 |                     var size = api.size([api.value(1) - api.value(0), yValue]); | 
 |                     var style = api.style(); | 
 |  | 
 |                     return { | 
 |                         type: 'rect', | 
 |                         shape: { | 
 |                             x: start[0], | 
 |                             y: start[1], | 
 |                             width: size[0], | 
 |                             height: size[1] | 
 |                         }, | 
 |                         style: style | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 var option = { | 
 |                     tooltip: { | 
 |                     }, | 
 |                     xAxis: { | 
 |                         scale: true | 
 |                     }, | 
 |                     yAxis: { | 
 |                     }, | 
 |                     series: [{ | 
 |                         type: 'custom', | 
 |                         renderItem: renderItem, | 
 |                         label: { | 
 |                             normal: { | 
 |                                 show: true, | 
 |                                 position: 'top' | 
 |                             } | 
 |                         }, | 
 |                         dimensions: ['from', 'to', 'profit'], | 
 |                         encode: { | 
 |                             x: [0, 1], | 
 |                             y: 2, | 
 |                             tooltip: [0, 1, 2] | 
 |                         }, | 
 |                         data: data | 
 |                     }] | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'profit', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 var categoryData = []; | 
 |                 var errorData = []; | 
 |                 var barData = []; | 
 |                 var dataCount = 100; | 
 |                 for (var i = 0; i < dataCount; i++) { | 
 |                     var val = Math.random() * 1000; | 
 |                     categoryData.push('category' + i); | 
 |                     errorData.push([ | 
 |                         i, | 
 |                         echarts.number.round(Math.max(0, val - Math.random() * 100)), | 
 |                         echarts.number.round(val + Math.random() * 80) | 
 |                     ]); | 
 |                     barData.push(echarts.number.round(val, 2)); | 
 |                 } | 
 |  | 
 |                 function renderItem(params, api) { | 
 |                     var xValue = api.value(0); | 
 |                     var highPoint = api.coord([xValue, api.value(1)]); | 
 |                     var lowPoint = api.coord([xValue, api.value(2)]); | 
 |                     var halfWidth = api.size([1, 0])[0] * 0.1; | 
 |                     var style = api.style({ | 
 |                         stroke: api.visual('color'), | 
 |                         fill: null | 
 |                     }); | 
 |  | 
 |                     return { | 
 |                         type: 'group', | 
 |                         children: [{ | 
 |                             type: 'line', | 
 |                             shape: { | 
 |                                 x1: highPoint[0] - halfWidth, y1: highPoint[1], | 
 |                                 x2: highPoint[0] + halfWidth, y2: highPoint[1] | 
 |                             }, | 
 |                             style: style | 
 |                         }, { | 
 |                             type: 'line', | 
 |                             shape: { | 
 |                                 x1: highPoint[0], y1: highPoint[1], | 
 |                                 x2: lowPoint[0], y2: lowPoint[1] | 
 |                             }, | 
 |                             style: style | 
 |                         }, { | 
 |                             type: 'line', | 
 |                             shape: { | 
 |                                 x1: lowPoint[0] - halfWidth, y1: lowPoint[1], | 
 |                                 x2: lowPoint[0] + halfWidth, y2: lowPoint[1] | 
 |                             }, | 
 |                             style: style | 
 |                         }] | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 var option = { | 
 |                     tooltip: { | 
 |                         trigger: 'axis' | 
 |                     }, | 
 |                     legend: { | 
 |                         data: ['bar', 'error'] | 
 |                     }, | 
 |                     dataZoom: [{ | 
 |                         type: 'slider', | 
 |                         start: 50, | 
 |                         end: 70 | 
 |                     }, { | 
 |                         type: 'inside', | 
 |                         start: 50, | 
 |                         end: 70 | 
 |                     }], | 
 |                     xAxis: { | 
 |                         data: categoryData | 
 |                     }, | 
 |                     yAxis: {}, | 
 |                     series: [{ | 
 |                         type: 'bar', | 
 |                         name: 'bar', | 
 |                         data: barData, | 
 |                         itemStyle: { | 
 |                             normal: { | 
 |                                 color: '#77bef7' | 
 |                             } | 
 |                         } | 
 |                     }, { | 
 |                         type: 'custom', | 
 |                         name: 'error', | 
 |                         itemStyle: { | 
 |                             normal: { | 
 |                                 borderWidth: 1.5 | 
 |                             } | 
 |                         }, | 
 |                         renderItem: renderItem, | 
 |                         encode: { | 
 |                             x: 0, | 
 |                             y: [1, 2] | 
 |                         }, | 
 |                         data: errorData, | 
 |                         z: 100 | 
 |                     }] | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'errorChart-cartesian-bar', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |                 // Prime Costs and Prices for ACME Fashion\nCollection "Spring-Summer, 2016" | 
 |                 // Data from https://playground.anychart.com/gallery/7.12.0/Error_Charts/Marker_Chart | 
 |                 var dimensions = [ | 
 |                     'name', 'Price', 'Prime cost', 'Prime cost min', 'Prime cost max', 'Price min', 'Price max' | 
 |                 ]; | 
 |                 var data = [ | 
 |                     ['Blouse "Blue Viola"', 101.88, 99.75, 76.75, 116.75, 69.88, 119.88], | 
 |                     ['Dress "Daisy"', 155.8, 144.03, 126.03, 156.03, 129.8, 188.8], | 
 |                     ['Trousers "Cutesy Classic"', 203.25, 173.56, 151.56, 187.56, 183.25, 249.25], | 
 |                     ['Dress "Morning Dew"', 256, 120.5, 98.5, 136.5, 236, 279], | 
 |                     ['Turtleneck "Dark Chocolate"', 408.89, 294.75, 276.75, 316.75, 385.89, 427.89], | 
 |                     ['Jumper "Early Spring"', 427.36, 430.24, 407.24, 452.24, 399.36, 461.36], | 
 |                     ['Breeches "Summer Mood"', 356, 135.5, 123.5, 151.5, 333, 387], | 
 |                     ['Dress "Mauve Chamomile"', 406, 95.5, 73.5, 111.5, 366, 429], | 
 |                     ['Dress "Flying Tits"', 527.36, 503.24, 488.24, 525.24, 485.36, 551.36], | 
 |                     ['Dress "Singing Nightingales"', 587.36, 543.24, 518.24, 555.24, 559.36, 624.36], | 
 |                     ['Sundress "Cloudy weather"', 603.36, 407.24, 392.24, 419.24, 581.36, 627.36], | 
 |                     ['Sundress "East motives"', 633.36, 477.24, 445.24, 487.24, 594.36, 652.36], | 
 |                     ['Sweater "Cold morning"', 517.36, 437.24, 416.24, 454.24, 488.36, 565.36], | 
 |                     ['Trousers "Lavender Fields"', 443.36, 387.24, 370.24, 413.24, 412.36, 484.36], | 
 |                     ['Jumper "Coffee with Milk"', 543.36, 307.24, 288.24, 317.24, 509.36, 574.36], | 
 |                     ['Blouse "Blooming Cactus"', 790.36, 277.24, 254.24, 295.24, 764.36, 818.36], | 
 |                     ['Sweater "Fluffy Comfort"', 790.34, 678.34, 660.34, 690.34, 762.34, 824.34] | 
 |                 ]; | 
 |  | 
 |                 function renderItem(params, api) { | 
 |                     var children = []; | 
 |                     var coordDims = ['x', 'y']; | 
 |  | 
 |                     for (var baseDimIdx = 0; baseDimIdx < 2; baseDimIdx++) { | 
 |                         var otherDimIdx = 1 - baseDimIdx; | 
 |                         var encode = params.encode; | 
 |                         var baseValue = api.value(encode[coordDims[baseDimIdx]][0]); | 
 |                         var param = []; | 
 |                         param[baseDimIdx] = baseValue; | 
 |                         param[otherDimIdx] = api.value(encode[coordDims[otherDimIdx]][1]); | 
 |                         var highPoint = api.coord(param); | 
 |                         param[otherDimIdx] = api.value(encode[coordDims[otherDimIdx]][2]); | 
 |                         var lowPoint = api.coord(param); | 
 |                         var halfWidth = 5; | 
 |  | 
 |                         var style = api.style({ | 
 |                             stroke: api.visual('color'), | 
 |                             fill: null | 
 |                         }); | 
 |  | 
 |                         children.push({ | 
 |                             type: 'line', | 
 |                             shape: makeShape( | 
 |                                 baseDimIdx, | 
 |                                 highPoint[baseDimIdx] - halfWidth, highPoint[otherDimIdx], | 
 |                                 highPoint[baseDimIdx] + halfWidth, highPoint[otherDimIdx] | 
 |                             ), | 
 |                             style: style | 
 |                         }, { | 
 |                             type: 'line', | 
 |                             shape: makeShape( | 
 |                                 baseDimIdx, | 
 |                                 highPoint[baseDimIdx], highPoint[otherDimIdx], | 
 |                                 lowPoint[baseDimIdx], lowPoint[otherDimIdx] | 
 |                             ), | 
 |                             style: style | 
 |                         }, { | 
 |                             type: 'line', | 
 |                             shape: makeShape( | 
 |                                 baseDimIdx, | 
 |                                 lowPoint[baseDimIdx] - halfWidth, lowPoint[otherDimIdx], | 
 |                                 lowPoint[baseDimIdx] + halfWidth, lowPoint[otherDimIdx] | 
 |                             ), | 
 |                             style: style | 
 |                         }); | 
 |                     } | 
 |  | 
 |                     function makeShape(baseDimIdx, base1, value1, base2, value2) { | 
 |                         var shape = {}; | 
 |                         shape[coordDims[baseDimIdx] + '1'] = base1; | 
 |                         shape[coordDims[1 - baseDimIdx] + '1'] = value1; | 
 |                         shape[coordDims[baseDimIdx] + '2'] = base2; | 
 |                         shape[coordDims[1 - baseDimIdx] + '2'] = value2; | 
 |                         return shape; | 
 |                     } | 
 |  | 
 |                     return { | 
 |                         type: 'group', | 
 |                         children: children | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 var option = { | 
 |                     tooltip: { | 
 |                     }, | 
 |                     legend: { | 
 |                         data: ['bar', 'error'] | 
 |                     }, | 
 |                     dataZoom: [{ | 
 |                         type: 'slider' | 
 |                     }, { | 
 |                         type: 'inside' | 
 |                     }], | 
 |                     xAxis: {}, | 
 |                     yAxis: {}, | 
 |                     series: [{ | 
 |                         type: 'scatter', | 
 |                         name: 'error', | 
 |                         data: data, | 
 |                         dimensions: dimensions, | 
 |                         encode: { | 
 |                             x: 2, | 
 |                             y: 1, | 
 |                             tooltip: [2, 1, 3, 4, 5, 6], | 
 |                             itemName: 0 | 
 |                         }, | 
 |                         itemStyle: { | 
 |                             normal: { | 
 |                                 color: '#77bef7' | 
 |                             } | 
 |                         } | 
 |                     }, { | 
 |                         type: 'custom', | 
 |                         name: 'error', | 
 |                         renderItem: renderItem, | 
 |                         dimensions: dimensions, | 
 |                         encode: { | 
 |                             x: [2, 3, 4], | 
 |                             y: [1, 5, 6], | 
 |                             tooltip: [2, 1, 3, 4, 5, 6], | 
 |                             itemName: 0 | 
 |                         }, | 
 |                         data: data, | 
 |                         z: 100 | 
 |                     }] | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'errorChart-cartesian-scatter', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 var yearCount = 7; | 
 |                 var categoryCount = 30; | 
 |  | 
 |                 var xAxisData = []; | 
 |                 var customData = []; | 
 |                 var legendData = []; | 
 |                 var dataList = []; | 
 |  | 
 |                 legendData.push('trend'); | 
 |                 var encodeY = []; | 
 |                 for (var i = 0; i < yearCount; i++) { | 
 |                     legendData.push((2010 + i) + ''); | 
 |                     dataList.push([]); | 
 |                     encodeY.push(1 + i); | 
 |                 }; | 
 |  | 
 |                 for (var i = 0; i < categoryCount; i++) { | 
 |                     var val = Math.random() * 1000; | 
 |                     xAxisData.push('category' + i); | 
 |                     var customVal = [i]; | 
 |                     customData.push(customVal); | 
 |  | 
 |                     var data = dataList[0]; | 
 |                     for (var j = 0; j < dataList.length; j++) { | 
 |                         var value = j === 0 | 
 |                             ? echarts.number.round(val, 2) | 
 |                             : echarts.number.round(Math.max(0, dataList[j - 1][i] + (Math.random() - 0.5) * 200), 2); | 
 |                         dataList[j].push(value); | 
 |                         customVal.push(value); | 
 |                     } | 
 |                 } | 
 |  | 
 |                 function renderItem(params, api) { | 
 |                     var xValue = api.value(0); | 
 |                     var currentSeriesIndices = api.currentSeriesIndices(); | 
 |                     var barLayout = api.barLayout({ | 
 |                         count: currentSeriesIndices.length - 1 | 
 |                     }); | 
 |  | 
 |                     var points = []; | 
 |                     for (var i = 0; i < currentSeriesIndices.length; i++) { | 
 |                         var seriesIndex = currentSeriesIndices[i]; | 
 |                         if (seriesIndex !== params.seriesIndex) { | 
 |                             var point = api.coord([xValue, api.value(seriesIndex)]); | 
 |                             point[0] += barLayout[i - 1].offsetCenter; | 
 |                             point[1] -= 20; | 
 |                             points.push(point); | 
 |                         } | 
 |                     } | 
 |                     var style = api.style({ | 
 |                         stroke: api.visual('color'), | 
 |                         fill: null | 
 |                     }); | 
 |  | 
 |                     return { | 
 |                         type: 'polyline', | 
 |                         shape: { | 
 |                             points: points | 
 |                         }, | 
 |                         style: style | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 var option = { | 
 |                     tooltip: { | 
 |                         trigger: 'axis' | 
 |                     }, | 
 |                     legend: { | 
 |                         data: legendData | 
 |                     }, | 
 |                     dataZoom: [{ | 
 |                         type: 'slider', | 
 |                         start: 50, | 
 |                         end: 70 | 
 |                     }, { | 
 |                         type: 'inside', | 
 |                         start: 50, | 
 |                         end: 70 | 
 |                     }], | 
 |                     xAxis: { | 
 |                         data: xAxisData | 
 |                     }, | 
 |                     yAxis: {}, | 
 |                     series: [{ | 
 |                         type: 'custom', | 
 |                         name: 'trend', | 
 |                         renderItem: renderItem, | 
 |                         itemStyle: { | 
 |                             normal: { | 
 |                                 borderWidth: 2 | 
 |                             } | 
 |                         }, | 
 |                         encode: { | 
 |                             x: 0, | 
 |                             y: encodeY | 
 |                         }, | 
 |                         data: customData, | 
 |                         z: 100 | 
 |                     }].concat(echarts.util.map(dataList, function (data, index) { | 
 |                         return { | 
 |                             type: 'bar', | 
 |                             animation: false, | 
 |                             name: legendData[index + 1], | 
 |                             itemStyle: { | 
 |                                 normal: { | 
 |                                     opacity: 0.5 | 
 |                                 } | 
 |                             }, | 
 |                             data: data | 
 |                         }; | 
 |                     })) | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'errorChart-cartesian-bar-multi', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 var data = []; | 
 |                 var dataCount = 7; | 
 |                 for (var i = 0; i < dataCount; i++) { | 
 |                     var val = Math.random() * 1000; | 
 |                     data.push([ | 
 |                         echarts.number.round(Math.random() * 100), | 
 |                         echarts.number.round(Math.random() * 400) | 
 |                     ]); | 
 |                 } | 
 |  | 
 |                 function renderItem(params, api) { | 
 |                     if (params.context.rendered) { | 
 |                         return; | 
 |                     } | 
 |                     params.context.rendered = true; | 
 |  | 
 |                     var points = []; | 
 |                     for (var i = 0; i < data.length; i++) { | 
 |                         points.push(api.coord(data[i])); | 
 |                     } | 
 |                     var color = api.visual('color'); | 
 |  | 
 |                     return { | 
 |                         type: 'polygon', | 
 |                         shape: { | 
 |                             points: echarts.graphic.clipPointsByRect(points, { | 
 |                                 x: params.coordSys.x, | 
 |                                 y: params.coordSys.y, | 
 |                                 width: params.coordSys.width, | 
 |                                 height: params.coordSys.height | 
 |                             }) | 
 |                         }, | 
 |                         style: api.style({ | 
 |                             fill: color, | 
 |                             stroke: echarts.color.lift(color) | 
 |                         }) | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 var option = { | 
 |                     tooltip: { | 
 |                         trigger: 'axis' | 
 |                     }, | 
 |                     legend: { | 
 |                         data: ['bar', 'error'] | 
 |                     }, | 
 |                     dataZoom: [{ | 
 |                         type: 'slider', | 
 |                         filterMode: 'none' | 
 |                     }, { | 
 |                         type: 'inside', | 
 |                         filterMode: 'none' | 
 |                     }], | 
 |                     xAxis: {}, | 
 |                     yAxis: {}, | 
 |                     series: [{ | 
 |                         type: 'custom', | 
 |                         renderItem: renderItem, | 
 |                         data: data | 
 |                     }] | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'cartesian-polygon', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 var layouts = [ | 
 |                     [[0, 0]], | 
 |                     [[-0.25, 0], [0.25, 0]], | 
 |                     [[0, -0.2], [-0.2, 0.2], [0.2, 0.2]], | 
 |                     [[-0.25, -0.25], [-0.25, 0.25], [0.25, -0.25], [0.25, 0.25]] | 
 |                 ]; | 
 |                 var paths = [ | 
 |                     'M936.857805 523.431322c0 0-42.065715-68.89513-88.786739-68.89513-46.68416 0-95.732122 71.223091-95.732122 71.223091s-44.28544-72.503296-93.440922-71.152538c-35.565466 0.977306-62.89705 30.882406-79.124275 64.06615L579.773747 790.800797c-3.253248 37.391565-5.677568 50.904371-12.002816 69.63497-6.651802 19.698688-19.544883 35.227341-31.650099 45.909606-14.30231 12.621414-29.59831 22.066586-45.854208 27.424563-16.28969 5.362074-30.098739 6.496973-51.536794 6.496973-19.498906 0-36.95104-2.963456-52.395418-8.850534-15.410586-5.887078-28.420403-14.313984-39.034573-25.246003-10.613146-10.930995-18.757939-24.08151-24.435507-39.525171-5.676544-15.443763-8.532685-40.195482-8.532685-59.270963l0-26.232454 74.435273 0c0 24.644301-0.17705 64.452915 8.81408 77.006848 9.02697 12.515021 22.756147 18.092032 41.148826 18.791014 16.728678 0.636518 30.032179-8.061645 30.032179-8.061645s11.922022-10.5472 14.992077-19.756954c2.674995-8.025805 3.565363-22.180147 3.565363-22.180147s2.080461-21.789286 2.080461-34.234675L489.399906 514.299369c-16.678502-18.827776-43.801395-61.938688-82.756096-60.927693-54.699008 1.419366-100.422144 70.059622-100.422144 70.059622s-56.065126-70.059622-93.440922-70.059622c-37.376717 0-91.077939 70.059622-91.077939 70.059622S105.343488 156.737741 476.742042 119.363584l53.70327-74.714624 51.373056 74.714624C964.889395 142.740992 936.857805 523.431322 936.857805 523.431322z', | 
 |                     'M533.504 268.288q33.792-41.984 71.68-75.776 32.768-27.648 74.24-50.176t86.528-19.456q63.488 5.12 105.984 30.208t67.584 63.488 34.304 87.04 6.144 99.84-17.92 97.792-36.864 87.04-48.64 74.752-53.248 61.952q-40.96 41.984-85.504 78.336t-84.992 62.464-73.728 41.472-51.712 15.36q-20.48 1.024-52.224-14.336t-69.632-41.472-79.872-61.952-82.944-75.776q-26.624-25.6-57.344-59.392t-57.856-74.24-46.592-87.552-21.504-100.352 11.264-99.84 39.936-83.456 65.536-61.952 88.064-35.328q24.576-5.12 49.152-1.536t48.128 12.288 45.056 22.016 40.96 27.648q45.056 33.792 86.016 80.896z', | 
 |                     'M741.06368 733.310464c8.075264-29.262438 20.615373-40.632422 14.64105-162.810061C966.089728 361.789952 967.93897 72.37847 967.855002 54.693683c0.279347-0.279347 0.418509-0.419533 0.418509-0.419533s-0.17705-0.00512-0.428749-0.00512c0-0.251699 0-0.428749 0-0.428749s-0.139162 0.14633-0.418509 0.425677c-17.695744-0.083866-307.10784 1.760051-515.833958 212.142592-122.181632-5.984256-133.55305 6.563533-162.815693 14.644531C235.35063 295.798886 103.552614 436.975309 90.630758 486.076621c-12.921856 49.105408 39.634227 56.859034 58.579558 58.581197 18.953421 1.724314 121.471386-9.475789 130.09111 4.309094 0 0 16.367411 11.200102 17.226035 41.346662 0.850432 29.796659 15.173222 71.354163 37.123994 97.267302-0.028672 0.027648-0.05632 0.054272-0.083866 0.074752 0.158618 0.13097 0.316211 0.261939 0.474829 0.390861 0.129946 0.149402 0.261939 0.319283 0.393011 0.468685 0.019456-0.019456 0.04608-0.049152 0.075776-0.075674 25.918362 21.961216 67.477504 36.272128 97.269248 37.122458 30.149837 0.859546 41.354547 17.234534 41.354547 17.234534 13.779354 8.608051 2.583962 111.122842 4.302131 130.075546 1.727386 18.95168 9.477222 71.498445 58.579558 58.576077C585.12896 918.526771 726.311117 786.734182 741.06368 733.310464zM595.893555 426.206003c-39.961702-39.965184-39.961702-104.75991 0-144.720077 39.970918-39.96928 104.768307-39.96928 144.730112 0 39.970918 39.960064 39.970918 104.75479 0 144.720077C700.661862 466.171187 635.864474 466.171187 595.893555 426.206003zM358.53312 769.516032c-31.923302-4.573184-54.890394-18.410291-71.41847-35.402342-16.984474-16.526438-30.830387-39.495475-35.405824-71.420621-4.649062-28.082586-20.856832-41.167565-38.76649-38.763827-17.906586 2.40681-77.046886 66.714419-80.857805 89.475891-3.80887 22.752154 29.271859 12.081152 46.424166 27.654861 17.151283 15.590093-2.139853 61.93664-14.733107 86.845952-6.441984 12.735078-10.289766 26.42176-4.22953 33.76087 7.346586 6.070272 21.03593 2.222592 33.769472-4.220109 24.912384-12.585677 71.258829-31.872922 86.842368-14.731469 15.583539 17.160806 4.911002 50.229965 27.674419 46.419251 22.754099-3.807744 87.065395-62.946611 89.466163-80.85248C399.70857 790.374093 386.627072 774.166938 358.53312 769.516032z', | 
 |                     'M848.794624 939.156685 571.780416 939.156685 571.780416 653.17123l341.897539 0 0 221.100654C913.677926 909.960704 884.482867 939.156685 848.794624 939.156685zM571.780403 318.743552c-11.861606-3.210138-31.443354-8.36864-39.829709-16.176435-0.596582-0.561766-1.016218-1.246413-1.613824-1.841971-0.560845 0.596582-1.016218 1.280205-1.613824 1.841971-8.386355 7.807795-15.96631 12.965274-27.827917 16.176435l0 263.544325L141.030675 582.287877 141.030675 355.202884c0-35.687834 29.195059-64.882688 64.883302-64.882688l150.649125 0c-16.984474-9.525965-32.846438-20.56233-46.111027-32.932045-60.250624-56.144691-71.129907-137.062605-24.283034-180.767027 19.615539-18.264986 46.252237-27.124736 75.026739-27.124736 39.933133 0 83.972915 17.070797 118.995968 49.706086 20.353331 18.983322 37.722624 43.405619 50.145075 69.056819 12.457267-25.6512 29.791744-50.074419 50.180915-69.056819 35.022029-32.63529 79.062835-49.706086 118.994944-49.706086 28.74071 0 55.410176 8.860774 75.025715 27.124736 46.882611 43.704422 35.96759 124.622336-24.283034 180.767027-13.264589 12.368691-29.127578 23.40608-46.111027 32.932045l144.649234 0c35.688243 0 64.882278 29.195981 64.882278 64.882688l0 227.084948L571.780416 582.287833 571.780416 318.743508zM435.064218 147.625267c-21.476966-19.965747-49.094144-31.913882-73.868288-31.913882-7.404954 0-21.125018 1.211597-29.863322 9.386803-2.000691 1.824563-8.070144 7.439462-8.070144 21.369754 0 15.650406 8.492749 40.24873 32.319386 62.477926 29.124506 27.12576 77.202432 47.601152 111.76704 47.601152 12.176794 0 16.492237-2.666701 16.527053-2.702541C489.524736 242.54505 475.664486 185.453773 435.064218 147.625267zM577.78135 254.790963c0 0 0.034816-0.034816 0.069632-0.034816 0.807424 0 5.50871 1.790771 15.509914 1.790771 34.564608 0 82.64151-20.47529 111.76704-47.601152 23.826637-22.229299 32.283546-46.810112 32.283546-62.442189 0-13.930291-6.033613-19.562496-8.035328-21.404467-8.77312-8.17623-22.457344-9.386803-29.864346-9.386803-24.808038 0-52.390298 11.948134-73.867264 31.913882C585.325466 185.208218 571.358822 241.73865 577.78135 254.790963zM500.89513 939.156685 205.914017 939.156685c-35.688243 0-64.883302-29.195981-64.883302-64.883712L141.030714 653.17123l359.864462 0L500.895177 939.15666z' | 
 |                 ]; | 
 |                 var colors = [ | 
 |                     '#c4332b', '#16B644', '#6862FD', '#FDC763' | 
 |                 ]; | 
 |  | 
 |                 function getVirtulData(year) { | 
 |                     year = year || '2017'; | 
 |                     var date = +echarts.number.parseDate(year + '-01-01'); | 
 |                     var end = +echarts.number.parseDate((+year + 1) + '-01-01'); | 
 |                     var dayTime = 3600 * 24 * 1000; | 
 |                     var data = []; | 
 |                     for (var time = date; time < end; time += dayTime) { | 
 |                         var items = []; | 
 |                         var eventCount = Math.round(Math.random() * paths.length); | 
 |                         for (var i = 0; i < eventCount; i++) { | 
 |                             items.push(Math.round(Math.random() * (paths.length - 1))); | 
 |                         } | 
 |                         data.push([ | 
 |                             echarts.format.formatTime('yyyy-MM-dd', time), | 
 |                             items.join('|') | 
 |                         ]); | 
 |                     } | 
 |                     return data; | 
 |                 } | 
 |  | 
 |                 function renderItem(params, api) { | 
 |                     var cellPoint = api.coord(api.value(0)); | 
 |                     var cellWidth = params.coordSys.cellWidth; | 
 |                     var cellHeight = params.coordSys.cellHeight; | 
 |  | 
 |                     var value = api.value(1); | 
 |                     var events = value && value.split('|'); | 
 |  | 
 |                     if (isNaN(cellPoint[0]) || isNaN(cellPoint[1])) { | 
 |                         return; | 
 |                     } | 
 |  | 
 |                     if (!events) { | 
 |                         return { | 
 |                             type: 'image', | 
 |                             style: { | 
 |                                 image: './data/hill-Qomolangma.png', | 
 |                                 x: cellPoint[0] - cellWidth / 2 + 10, | 
 |                                 y: cellPoint[1] - cellHeight / 2 + 10, | 
 |                                 width: cellWidth - 20, | 
 |                                 height: cellHeight - 20, | 
 |                                 opacity: 0.7 | 
 |                             } | 
 |                         }; | 
 |                     } | 
 |  | 
 |                     var group = { | 
 |                         type: 'group', | 
 |                         children: echarts.util.map(layouts[events.length - 1], function (itemLayout, index) { | 
 |                             return { | 
 |                                 type: 'path', | 
 |                                 shape: { | 
 |                                     pathData: paths[events[index]], | 
 |                                     x: -8, | 
 |                                     y: -8, | 
 |                                     width: 16, | 
 |                                     height: 16 | 
 |                                 }, | 
 |                                 position: [ | 
 |                                     cellPoint[0] + echarts.number.linearMap(itemLayout[0], [-0.5, 0.5], [-cellWidth / 2, cellWidth / 2]), | 
 |                                     cellPoint[1] + echarts.number.linearMap(itemLayout[1], [-0.5, 0.5], [-cellHeight / 2 + 20, cellHeight / 2]) | 
 |                                 ], | 
 |                                 style: api.style({ | 
 |                                     fill: colors[events[index]] | 
 |                                 }) | 
 |                             }; | 
 |                         }) || [] | 
 |                     }; | 
 |  | 
 |                     group.children.push({ | 
 |                         type: 'text', | 
 |                         style: { | 
 |                             x: cellPoint[0], | 
 |                             y: cellPoint[1] - cellHeight / 2 + 15, | 
 |                             text: echarts.format.formatTime('dd', api.value(0)), | 
 |                             fill: '#777', | 
 |                             textFont: api.font({fontSize: 14}) | 
 |                         } | 
 |                     }); | 
 |  | 
 |                     return group; | 
 |                 } | 
 |  | 
 |                 var option = { | 
 |                     tooltip: { | 
 |                     }, | 
 |                     calendar: [{ | 
 |                         left: 'center', | 
 |                         top: 'middle', | 
 |                         cellSize: [70, 70], | 
 |                         yearLabel: {show: false}, | 
 |                         orient: 'vertical', | 
 |                         dayLabel: { | 
 |                             firstDay: 1, | 
 |                             nameMap: 'cn' | 
 |                         }, | 
 |                         monthLabel: { | 
 |                             show: false | 
 |                         }, | 
 |                         range: '2017-03' | 
 |                     }], | 
 |                     series: [{ | 
 |                         type: 'custom', | 
 |                         coordinateSystem: 'calendar', | 
 |                         renderItem: renderItem, | 
 |                         dimensions: [null, {type: 'ordinal'}], | 
 |                         data: getVirtulData(2017) | 
 |                     }] | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'calendar', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 var textData = []; | 
 |                 var imageData = []; | 
 |                 var pathData = []; | 
 |                 var dataCount = 30; | 
 |                 var words = ['echarts', 'good morning', '易查词', '自定义文字']; | 
 |  | 
 |                 for (var i = 0; i < dataCount; i++) { | 
 |                     var val = Math.random() * 1000; | 
 |                     textData.push([Math.random(), Math.random(), words[Math.round(Math.random() * (words.length - 1))]]); | 
 |                     var imagePoint = [Math.random(), Math.random()]; | 
 |                     imageData.push([ | 
 |                         imagePoint[0], imagePoint[1], | 
 |                         imagePoint[0] + Math.random() / 20, imagePoint[1] + Math.random() / 20 | 
 |                     ]); | 
 |                     var pathPoint = [Math.random(), Math.random()]; | 
 |                     pathData.push([pathPoint[0], pathPoint[1]]); | 
 |                 } | 
 |  | 
 |                 function renderItemText(params, api) { | 
 |                     var point = api.coord([api.value(0), api.value(1)]); | 
 |  | 
 |                     return { | 
 |                         type: 'text', | 
 |                         style: { | 
 |                             text: api.value(2), | 
 |                             x: point[0], | 
 |                             y: point[1] | 
 |                         } | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 function renderItemImage(params, api) { | 
 |                     var leftTop = api.coord([api.value(0), api.value(1)]); | 
 |                     var rightBottom = api.coord([api.value(2), api.value(3)]); | 
 |  | 
 |                     return { | 
 |                         type: 'image', | 
 |                         style: { | 
 |                             image: './data/hill-Qomolangma.png', | 
 |                             x: leftTop[0], | 
 |                             y: leftTop[1], | 
 |                             width: rightBottom[0] - leftTop[0], | 
 |                             height: rightBottom[1] - leftTop[1] | 
 |                         } | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 function renderItemPath(params, api) { | 
 |                     return { | 
 |                         type: 'path', | 
 |                         shape: { | 
 |                             pathData: 'M936.857805 523.431322c0 0-42.065715-68.89513-88.786739-68.89513-46.68416 0-95.732122 71.223091-95.732122 71.223091s-44.28544-72.503296-93.440922-71.152538c-35.565466 0.977306-62.89705 30.882406-79.124275 64.06615L579.773747 790.800797c-3.253248 37.391565-5.677568 50.904371-12.002816 69.63497-6.651802 19.698688-19.544883 35.227341-31.650099 45.909606-14.30231 12.621414-29.59831 22.066586-45.854208 27.424563-16.28969 5.362074-30.098739 6.496973-51.536794 6.496973-19.498906 0-36.95104-2.963456-52.395418-8.850534-15.410586-5.887078-28.420403-14.313984-39.034573-25.246003-10.613146-10.930995-18.757939-24.08151-24.435507-39.525171-5.676544-15.443763-8.532685-40.195482-8.532685-59.270963l0-26.232454 74.435273 0c0 24.644301-0.17705 64.452915 8.81408 77.006848 9.02697 12.515021 22.756147 18.092032 41.148826 18.791014 16.728678 0.636518 30.032179-8.061645 30.032179-8.061645s11.922022-10.5472 14.992077-19.756954c2.674995-8.025805 3.565363-22.180147 3.565363-22.180147s2.080461-21.789286 2.080461-34.234675L489.399906 514.299369c-16.678502-18.827776-43.801395-61.938688-82.756096-60.927693-54.699008 1.419366-100.422144 70.059622-100.422144 70.059622s-56.065126-70.059622-93.440922-70.059622c-37.376717 0-91.077939 70.059622-91.077939 70.059622S105.343488 156.737741 476.742042 119.363584l53.70327-74.714624 51.373056 74.714624C964.889395 142.740992 936.857805 523.431322 936.857805 523.431322z', | 
 |                             x: -10, | 
 |                             y: -10, | 
 |                             width: 20, | 
 |                             height: 20 | 
 |                         }, | 
 |                         position: api.coord([api.value(0), api.value(1)]), | 
 |                         style: api.style() | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 var option = { | 
 |                     tooltip: { | 
 |                         trigger: 'axis' | 
 |                     }, | 
 |                     legend: { | 
 |                         data: ['text', 'image', 'path'] | 
 |                     }, | 
 |                     dataZoom: [{ | 
 |                         type: 'slider', | 
 |                         filterMode: 'weakFilter', | 
 |                         start: 50, | 
 |                         end: 70 | 
 |                     }, { | 
 |                         type: 'inside', | 
 |                         filterMode: 'weakFilter', | 
 |                         start: 50, | 
 |                         end: 70 | 
 |                     }], | 
 |                     xAxis: {}, | 
 |                     yAxis: {}, | 
 |                     series: [{ | 
 |                         type: 'custom', | 
 |                         name: 'text', | 
 |                         data: textData, | 
 |                         dimensions: [null, null, {type: 'ordinal'}], | 
 |                         renderItem: renderItemText | 
 |                     }, { | 
 |                         type: 'custom', | 
 |                         name: 'image', | 
 |                         data: imageData, | 
 |                         encode: { | 
 |                             x: [0, 2], | 
 |                             y: [1, 3] | 
 |                         }, | 
 |                         renderItem: renderItemImage | 
 |                     }, { | 
 |                         type: 'custom', | 
 |                         name: 'path', | 
 |                         data: pathData, | 
 |                         renderItem: renderItemPath | 
 |                     }] | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'text-image-update', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 function renderItem(params, api) { | 
 |                     var values = [api.value(0), api.value(1)]; | 
 |                     var coord = api.coord(values); | 
 |                     var size = api.size([1, 1], values); | 
 |                     return { | 
 |                         type: 'sector', | 
 |                         shape: { | 
 |                             cx: params.coordSys.cx, | 
 |                             cy: params.coordSys.cy, | 
 |                             r0: coord[2] - size[0] / 2, | 
 |                             r: coord[2] + size[0] / 2, | 
 |                             startAngle: coord[3] - size[1] / 2, | 
 |                             endAngle: coord[3] + size[1] / 2 | 
 |                         }, | 
 |                         style: api.style({ | 
 |                             fill: api.visual('color') | 
 |                         }) | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 var hours = ['12a', '1a', '2a', '3a', '4a', '5a', '6a', | 
 |                         '7a', '8a', '9a','10a','11a', | 
 |                         '12p', '1p', '2p', '3p', '4p', '5p', | 
 |                         '6p', '7p', '8p', '9p', '10p', '11p']; | 
 |                 var days = ['Saturday', 'Friday', 'Thursday', | 
 |                         'Wednesday', 'Tuesday', 'Monday', 'Sunday']; | 
 |  | 
 |                 var data = [[0,0,5],[0,1,1],[0,2,0],[0,3,0],[0,4,0],[0,5,0],[0,6,0],[0,7,0],[0,8,0],[0,9,0],[0,10,0],[0,11,2],[0,12,4],[0,13,1],[0,14,1],[0,15,3],[0,16,4],[0,17,6],[0,18,4],[0,19,4],[0,20,3],[0,21,3],[0,22,2],[0,23,5],[1,0,7],[1,1,0],[1,2,0],[1,3,0],[1,4,0],[1,5,0],[1,6,0],[1,7,0],[1,8,0],[1,9,0],[1,10,5],[1,11,2],[1,12,2],[1,13,6],[1,14,9],[1,15,11],[1,16,6],[1,17,7],[1,18,8],[1,19,12],[1,20,5],[1,21,5],[1,22,7],[1,23,2],[2,0,1],[2,1,1],[2,2,0],[2,3,0],[2,4,0],[2,5,0],[2,6,0],[2,7,0],[2,8,0],[2,9,0],[2,10,3],[2,11,2],[2,12,1],[2,13,9],[2,14,8],[2,15,10],[2,16,6],[2,17,5],[2,18,5],[2,19,5],[2,20,7],[2,21,4],[2,22,2],[2,23,4],[3,0,7],[3,1,3],[3,2,0],[3,3,0],[3,4,0],[3,5,0],[3,6,0],[3,7,0],[3,8,1],[3,9,0],[3,10,5],[3,11,4],[3,12,7],[3,13,14],[3,14,13],[3,15,12],[3,16,9],[3,17,5],[3,18,5],[3,19,10],[3,20,6],[3,21,4],[3,22,4],[3,23,1],[4,0,1],[4,1,3],[4,2,0],[4,3,0],[4,4,0],[4,5,1],[4,6,0],[4,7,0],[4,8,0],[4,9,2],[4,10,4],[4,11,4],[4,12,2],[4,13,4],[4,14,4],[4,15,14],[4,16,12],[4,17,1],[4,18,8],[4,19,5],[4,20,3],[4,21,7],[4,22,3],[4,23,0],[5,0,2],[5,1,1],[5,2,0],[5,3,3],[5,4,0],[5,5,0],[5,6,0],[5,7,0],[5,8,2],[5,9,0],[5,10,4],[5,11,1],[5,12,5],[5,13,10],[5,14,5],[5,15,7],[5,16,11],[5,17,6],[5,18,0],[5,19,5],[5,20,3],[5,21,4],[5,22,2],[5,23,0],[6,0,1],[6,1,0],[6,2,0],[6,3,0],[6,4,0],[6,5,0],[6,6,0],[6,7,0],[6,8,0],[6,9,0],[6,10,1],[6,11,0],[6,12,2],[6,13,1],[6,14,3],[6,15,4],[6,16,0],[6,17,0],[6,18,0],[6,19,0],[6,20,1],[6,21,2],[6,22,2],[6,23,6]]; | 
 |                 var maxValue = echarts.util.reduce(data, function (max, item) { | 
 |                     return Math.max(max, item[2]); | 
 |                 }, -Infinity); | 
 |  | 
 |                 option = { | 
 |                     legend: { | 
 |                         data: ['Punch Card'] | 
 |                     }, | 
 |                     polar: {}, | 
 |                     tooltip: { | 
 |                     }, | 
 |                     animation: false, | 
 |                     dataZoom: { | 
 |                         type: 'slider', | 
 |                         radiusAxisIndex: 0 | 
 |                     }, | 
 |                     visualMap: { | 
 |                         type: 'continuous', | 
 |                         min: 0, | 
 |                         max: maxValue, | 
 |                         dimension: 2, | 
 |                         calculable: true | 
 |                     }, | 
 |                     angleAxis: { | 
 |                         type: 'category', | 
 |                         data: hours, | 
 |                         boundaryGap: false, | 
 |                         splitLine: { | 
 |                             show: true, | 
 |                             lineStyle: { | 
 |                                 color: '#ddd', | 
 |                                 type: 'dashed' | 
 |                             } | 
 |                         }, | 
 |                         axisLine: { | 
 |                             show: false | 
 |                         } | 
 |                     }, | 
 |                     radiusAxis: { | 
 |                         type: 'category', | 
 |                         data: days, | 
 |                         axisLabel: { | 
 |                             rotate: 45 | 
 |                         }, | 
 |                         z: 100 | 
 |                     }, | 
 |                     series: [{ | 
 |                         name: 'Punch Card', | 
 |                         type: 'custom', | 
 |                         coordinateSystem: 'polar', | 
 |                         itemStyle: { | 
 |                             normal: { | 
 |                                 color: '#d14a61' | 
 |                             } | 
 |                         }, | 
 |                         renderItem: renderItem, | 
 |                         data: data | 
 |                     }] | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'polar-block', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |  | 
 |                 var data = [ | 
 |                     {name:'广州', value: 50}, | 
 |                     {name:'深圳', value: 72}, | 
 |                     {name:'珠海', value: 30}, | 
 |                     {name:'佛山', value: 38}, | 
 |                     {name:'杭州', value: 42}, | 
 |                     {name:'舟山', value: 32}, | 
 |                     {name:'宁波', value: 52} | 
 |                 ]; | 
 |  | 
 |                 var option = { | 
 |                     tooltip : { | 
 |                         trigger: 'item' | 
 |                     }, | 
 |                     legend: { | 
 |                         data:['广州','深圳','珠海','佛山','杭州','舟山','宁波'], | 
 |                         top: 0, | 
 |                         left: 'center' | 
 |                     }, | 
 |                     xAxis : [ | 
 |                         { | 
 |                             type : 'category', | 
 |                             data : [0], | 
 |                             axisTick: {show: false}, | 
 |                             axisLabel: {show: false} | 
 |                         }, | 
 |                     ], | 
 |                     yAxis : [ | 
 |                         { | 
 |                             type : 'value' | 
 |                         } | 
 |                     ], | 
 |                     series : echarts.util.map(data, function (item) { | 
 |                         return { | 
 |                             name: item.name, | 
 |                             type: 'bar', | 
 |                             label: { | 
 |                                 normal: { | 
 |                                     show: true, | 
 |                                     position: 'bottom', | 
 |                                     formatter: function (param) { | 
 |                                         return param.seriesName; | 
 |                                     } | 
 |                                 } | 
 |                             }, | 
 |                             data: [item.value] | 
 |                         } | 
 |                     }).concat([{ | 
 |                         type: 'custom', | 
 |                         renderItem: renderProvinceName, | 
 |                         data: [0] | 
 |                     }]) | 
 |                 }; | 
 |  | 
 |                 function renderProvinceName(param, api) { | 
 |                     var currentSeriesIndices = api.currentSeriesIndices(); | 
 |                     currentSeriesIndices.pop(); // remove custom series; | 
 |  | 
 |                     var barLayout = api.barLayout({ | 
 |                         count: currentSeriesIndices.length | 
 |                     }); | 
 |  | 
 |                     var nameTexts = echarts.util.map(currentSeriesIndices, function (serIdx, index) { | 
 |                         var point = api.coord([0, 0]); | 
 |                         point[0] += barLayout[index].offsetCenter; | 
 |                         point[1] = api.getHeight() - 20; | 
 |  | 
 |                         return { | 
 |                             position: point, | 
 |                             name: serIdx, | 
 |                             type: 'circle', | 
 |                             shape: { | 
 |                                 cx: 0, cy: 0, r: 10 | 
 |                             }, | 
 |                             style: { | 
 |                                 text: serIdx, | 
 |                                 fill: '#333', | 
 |                                 textFill: '#eee', | 
 |                                 stroke: null | 
 |                             } | 
 |                         }; | 
 |                     }); | 
 |  | 
 |                     return { | 
 |                         type: 'group', | 
 |                         $mergeChildren: 'byName', | 
 |                         children: nameTexts | 
 |                     }; | 
 |                 } | 
 |  | 
 |                 testHelper.createChart(echarts, 'diff-children-by-name', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |         <script> | 
 |             require(['echarts'], function (echarts) { | 
 |                 var hours = [ | 
 |                     '12a', '1a', '2a', '3a', '4a', '5a', '6a', | 
 |                     '7a', '8a', '9a', '10a', '11a', | 
 |                     '12p', '1p', '2p', '3p', '4p', '5p', | 
 |                     '6p', '7p', '8p', '9p', '10p', '11p' | 
 |                 ]; | 
 |                 var days = [ | 
 |                     'Saturday', 'Friday', 'Thursday', | 
 |                     'Wednesday', 'Tuesday', 'Monday', 'Sunday' | 
 |                 ]; | 
 |                 var data = [[0, 0, 5], [0, 1, 1], [0, 2, 0], [0, 3, 0], [0, 4, 0], [0, 5, 0], [0, 6, 0], [0, 7, 0], [0, 8, 0], [0, 9, 0], [0, 10, 0], [0, 11, 2], [0, 12, 4], [0, 13, 1], [0, 14, 1], [0, 15, 3], [0, 16, 4], [0, 17, 6], [0, 18, 4], [0, 19, 4], [0, 20, 3], [0, 21, 3], [0, 22, 2], [0, 23, 5], [1, 0, 7], [1, 1, 0], [1, 2, 0], [1, 3, 0], [1, 4, 0], [1, 5, 0], [1, 6, 0], [1, 7, 0], [1, 8, 0], [1, 9, 0], [1, 10, 5], [1, 11, 2], [1, 12, 2], [1, 13, 6], [1, 14, 9], [1, 15, 11], [1, 16, 6], [1, 17, 7], [1, 18, 8], [1, 19, 12], [1, 20, 5], [1, 21, 5], [1, 22, 7], [1, 23, 2], [2, 0, 1], [2, 1, 1], [2, 2, 0], [2, 3, 0], [2, 4, 0], [2, 5, 0], [2, 6, 0], [2, 7, 0], [2, 8, 0], [2, 9, 0], [2, 10, 3], [2, 11, 2], [2, 12, 1], [2, 13, 9], [2, 14, 8], [2, 15, 10], [2, 16, 6], [2, 17, 5], [2, 18, 5], [2, 19, 5], [2, 20, 7], [2, 21, 4], [2, 22, 2], [2, 23, 4], [3, 0, 7], [3, 1, 3], [3, 2, 0], [3, 3, 0], [3, 4, 0], [3, 5, 0], [3, 6, 0], [3, 7, 0], [3, 8, 1], [3, 9, 0], [3, 10, 5], [3, 11, 4], [3, 12, 7], [3, 13, 14], [3, 14, 13], [3, 15, 12], [3, 16, 9], [3, 17, 5], [3, 18, 5], [3, 19, 10], [3, 20, 6], [3, 21, 4], [3, 22, 4], [3, 23, 1], [4, 0, 1], [4, 1, 3], [4, 2, 0], [4, 3, 0], [4, 4, 0], [4, 5, 1], [4, 6, 0], [4, 7, 0], [4, 8, 0], [4, 9, 2], [4, 10, 4], [4, 11, 4], [4, 12, 2], [4, 13, 4], [4, 14, 4], [4, 15, 14], [4, 16, 12], [4, 17, 1], [4, 18, 8], [4, 19, 5], [4, 20, 3], [4, 21, 7], [4, 22, 3], [4, 23, 0], [5, 0, 2], [5, 1, 1], [5, 2, 0], [5, 3, 3], [5, 4, 0], [5, 5, 0], [5, 6, 0], [5, 7, 0], [5, 8, 2], [5, 9, 0], [5, 10, 4], [5, 11, 1], [5, 12, 5], [5, 13, 10], [5, 14, 5], [5, 15, 7], [5, 16, 11], [5, 17, 6], [5, 18, 0], [5, 19, 5], [5, 20, 3], [5, 21, 4], [5, 22, 2], [5, 23, 0], [6, 0, 1], [6, 1, 0], [6, 2, 0], [6, 3, 0], [6, 4, 0], [6, 5, 0], [6, 6, 0], [6, 7, 0], [6, 8, 0], [6, 9, 0], [6, 10, 1], [6, 11, 0], [6, 12, 2], [6, 13, 1], [6, 14, 3], [6, 15, 4], [6, 16, 0], [6, 17, 0], [6, 18, 0], [6, 19, 0], [6, 20, 1], [6, 21, 2], [6, 22, 2], [6, 23, 6]]; | 
 |                 var title = []; | 
 |                 var singleAxis = []; | 
 |                 var series = []; | 
 |                 days.forEach(function (day, idx) { | 
 |                     title.push({ | 
 |                         textBaseline: 'middle', | 
 |                         top: ((idx + 0.5) * 100) / 7 + '%', | 
 |                         text: day | 
 |                     }); | 
 |                     singleAxis.push({ | 
 |                         left: 150, | 
 |                         type: 'category', | 
 |                         boundaryGap: false, | 
 |                         data: hours, | 
 |                         top: (idx * 100) / 7 + 5 + '%', | 
 |                         height: 100 / 7 - 10 + '%', | 
 |                         axisLabel: { | 
 |                             interval: 2 | 
 |                         } | 
 |                     }); | 
 |                     series.push({ | 
 |                         singleAxisIndex: idx, | 
 |                         coordinateSystem: 'singleAxis', | 
 |                         type: 'custom', | 
 |                         data: [], | 
 |                         renderItem: function(params, api) { | 
 |                             var coord = api.coord([api.value(0)]); | 
 |                             var radius = api.value(1); | 
 |                             return { | 
 |                                 type: 'circle', | 
 |                                 shape: { | 
 |                                     cx: coord[0], | 
 |                                     cy: coord[1], | 
 |                                     r: radius | 
 |                                 }, | 
 |                                 style: api.style({ | 
 |                                     fill: api.visual('color') | 
 |                                 }) | 
 |                             }; | 
 |                         } | 
 |                     }); | 
 |                 }); | 
 |                 data.forEach(function (dataItem) { | 
 |                     series[dataItem[0]].data.push([dataItem[1], dataItem[2]]); | 
 |                 }); | 
 |                 var option = { | 
 |                     title: title, | 
 |                     singleAxis: singleAxis, | 
 |                     series: series | 
 |                 }; | 
 |  | 
 |                 testHelper.createChart(echarts, 'custom-single-axis', option); | 
 |             }); | 
 |         </script> | 
 |  | 
 |  | 
 |  | 
 |  | 
 |  | 
 |     </body> | 
 | </html> |