title: ECharts: Display Legend for Treemap?
body: <p>The treemap below has two levels. I want to display a legend for the top level nodes (Node A and Node B). With other types of charts I've used, the legend can be auto-generated or I can define it explicitly. With the treemap, it appears one is not auto-generated, and if I define one explicitly, it is never displayed.  Is it possible to display a legend for a treemap?</p>
  
  <pre><code>&lt;style&gt;
      #chart {
          position: absolute;
          border: 1px solid;
          top: 100px;
          left: 100px;
          right: 100px;
          bottom: 100px;
          border: 1px solid black;
      }
  &lt;/style&gt;
  
  
  &lt;div id="chart"&gt;&lt;/div&gt;
  
  
  &lt;script src="http://echarts.baidu.com/dist/echarts.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      var options = {
          series: [{
              type: 'treemap',
              data: [{
                  name: 'Node A',
                  value: 20,
                  children: [{
                      name: 'Node A1',
                      value: 12
                  }, {
                      name: 'Node A2',
                      value: 8
                  }]
              }, {
                  name: 'Node B',
                  value: 20,
                  children: [{
                      name: 'Node B1',
                      value: 20
                  }]
              }]
          }]
      };
      var chart = echarts.init(document.getElementById("chart"));
      chart.setOption(options);
  &lt;/script&gt;
  </code></pre>