title: Add Custom Legend with Color Indicator ASP.NET Chart
body: <p>Straightforwardly.. May i ask how to create a custom legend at the bottom of my charts?</p>
  
  <p>Legend would be.. <strong>Red</strong> Low Bed Number</p>
  
  <p>Codes in designer:</p>
  
  <pre><code>                &lt;asp:Chart ID="ChartClass" Visible="false" runat="server" Height="500px" Width="720px"&gt; 
                  &lt;Series&gt;
                      &lt;asp:Series Name="SeriesAvailableClass" IsValueShownAsLabel="True" LabelAngle="-90" Font="Microsoft Sans Serif, 12pt" Legend="LegendClass" ChartArea="ChartAreaClass" ChartType="Column"&gt;
                          &lt;SmartLabelStyle Enabled="false" /&gt;
                      &lt;/asp:Series&gt;
                      &lt;asp:Series Name="SeriesAllotedClass" IsValueShownAsLabel="True" LabelAngle="-90" Font="Microsoft Sans Serif, 12pt" Legend="LegendClass" ChartArea="ChartAreaClass" ChartType="Column"&gt;
                          &lt;SmartLabelStyle Enabled="false"/&gt;
                      &lt;/asp:Series&gt;
                  &lt;/Series&gt;
                  &lt;ChartAreas&gt;
                      &lt;asp:ChartArea Name="ChartAreaClass"&gt;
                          &lt;AxisX Title="Class"&gt;
                              &lt;MajorGrid Enabled="false" /&gt;
                          &lt;/AxisX&gt;
                          &lt;AxisY Title="Number of Beds"&gt;
                              &lt;MajorGrid Enabled="false" /&gt;
                          &lt;/AxisY&gt;
                      &lt;/asp:ChartArea&gt;
                  &lt;/ChartAreas&gt;
                  &lt;Legends&gt;
                      &lt;asp:Legend Docking="Bottom" Name="LegendClass"&gt;&lt;/asp:Legend&gt;
                  &lt;/Legends&gt;
                  &lt;Titles&gt;
                      &lt;asp:Title Name="TitleChart" Font="Microsoft Sans Serif, 15pt, style=Bold" Text="Beds Statistics Summary (Class)" Alignment="TopCenter"&gt;&lt;/asp:Title&gt;
                  &lt;/Titles&gt;
                  &lt;/asp:Chart&gt;
  </code></pre>
  
  <p>Codes back end:</p>
  
  <pre><code>        Series seriesAvail = ChartClass.Series.Add("SeriesAvailableClass");
          seriesAvail.Color = Color.ForestGreen;
          seriesAvail.LegendText = "Available Number of Beds";
          seriesAvail.IsValueShownAsLabel = true;
          seriesAvail.LabelAngle = 0;
          seriesAvail.Font = new Font("Microsoft Sans Serif", 8);
          seriesAvail.SmartLabelStyle.Enabled = false;
  
  
          String[] classArrAvail = { "A1", "B1", "B2", "C1" };
          int[] countAvailable = { A1Available, B1Available, B2Available, C1Available };
  
          ChartClass.Series["SeriesAvailableClass"].Points.DataBindXY(classArrAvail, countAvailable);
  
          foreach (DataPoint pt in ChartClass.Series["SeriesAvailableClass"].Points)
          {
              if (pt.YValues[0] &lt; 10)
              {
                  pt.Color = Color.Red;
              }
              else if (pt.YValues[0] &gt;= 10)
              {
                  pt.Color = Color.ForestGreen;
              }
  
          }
  
  
          Series seriesAlloted = ChartClass.Series.Add("SeriesAllotedClass");
          seriesAlloted.Color = Color.SkyBlue;
          seriesAlloted.LegendText = "Alloted Number of Beds";
          seriesAlloted.IsValueShownAsLabel = true;
          seriesAlloted.LabelAngle = 0;
          seriesAlloted.Font = new Font("Microsoft Sans Serif", 8);
          seriesAlloted.SmartLabelStyle.Enabled = true;
  
          String[] classArrAlloted = { "A1", "B1", "B2", "C1" };
          int[] countAlloted = { A1Alloted, B1Alloted, B2Alloted, C1Alloted };
  
          ChartClass.Series["SeriesAllotedClass"].Points.DataBindXY(classArrAlloted, countAlloted);
  </code></pre>
  
  <p>Image:</p>
  
  <p><a href="https://i.stack.imgur.com/nFYDM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nFYDM.png" alt="enter image description here"></a></p>
  
  <p>I have tried looking and searching online. Can't seem to find any reliable sources or solutions that i'm looking for.</p>
  
  <p>Most of the solutions are having legend added to a specific series.</p>
  
  <p>I'm fairly new to ms-chart...</p>
  
  <p>Appreciate any help. Thank you..</p>