title: How to add legends in Amserial charts
body: <p>I am using Amcharts in my AngularJS Application to create a simple bar chart.The following is my code in the controller:</p>
  
  <pre><code>        let empChart;
          let empBarGraph;
          let empLine;
          const writeemp = data =&gt; {
              const {
                  total,
                  employees,
              } = data;
  
              empChart.dataProvider = e;
              empChart.write('emp');
              empChart.validateData();
          };
  
          AmCharts.handleLoad();
  
          var configChart = function () {
  
  
              empChart = new AmCharts.AmSerialChart();
              empChart.categoryField = "state";
              empChart.labelRotation = 90;
  
              var yAxis = new AmCharts.ValueAxis();
              yAxis.position = "left";
              empChart.addValueAxis(yAxis);
  
  
              empBarGraph = new AmCharts.AmGraph();
              empBarGraph.valueField = "count";
              empBarGraph.type = "column";
              empBarGraph.fillAlphas = 1;
              empBarGraph.lineColor = "#f0ab00";
              empBarGraph.valueAxis = yAxis;
              empChart.addGraph(empBarGraph);
              empChart.write('empChart');
  
  
              $http.get(hostNameService.getHostName()+"/dashboard/employees/statecount")
                  .then(response =&gt; writeemp(response.data));
          }
  </code></pre>
  
  <p>Code in html:</p>
  
  <pre><code>                       &lt;div class='panel-body'&gt;
                              &lt;div id="empChart"&gt;&lt;/div&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>This would return me the values of State on x-axis and count on y-axis. I wanted to filter the chart based on the value of state and was not sure how to create the legends for this chart. could anyone suggest me on how to use legends. I want to create legends for the state value that is being returned.</p>