legend is not showing

Hello, 

How do I make the data legend appear?

Thanks

Fernando


  <ejs-chart textRender="onTextRenderNivel" height="230px" id="containerNivel" locale="pt" width="100%" theme="Fabric">
      <e-chart-legendsettings visible="true" position="Left"></e-chart-legendsettings>
      <e-chart-primaryxaxis title="Tempo" valueType="Category" labelPlacement=OnTicks interval="1">
      </e-chart-primaryxaxis>
      <e-chart-primaryyaxis isInversed=true title="Nível (metros)"></e-chart-primaryyaxis>
      <e-series-collection>
          <e-series fill='#00afef' xName="x" yName="y"
                    type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
              <e-data-manager url="/Outorga/GraficoNivelMax_Read"
                              adaptor="UrlAdaptor">
              </e-data-manager>
              <e-series-marker>
                  <e-series-datalabel visible="true"></e-series-datalabel>
              </e-series-marker>
          </e-series>
          <e-series fill='red' xName="x" yName="y"
                    type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
              <e-data-manager url="/Outorga/GraficoNivelMin_Read"
                              adaptor="UrlAdaptor">
              </e-data-manager>
              <e-series-marker>
                  <e-series-datalabel visible="true"></e-series-datalabel>
              </e-series-marker>
          </e-series>
          <e-series fill='green' xName="x" yName="y"
                    type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
              <e-data-manager url="/Outorga/GraficoNivelMed_Read"
                              adaptor="UrlAdaptor">
              </e-data-manager>
              <e-series-marker>
                  <e-series-datalabel visible="true"></e-series-datalabel>
              </e-series-marker>
          </e-series>
      </e-series-collection>
  </ejs-chart>


Image_3452_1730378120683


1 Reply

NP Nishanthi Panner Selvam Syncfusion Team November 1, 2024 07:23 AM UTC

Fernando,


We have analyzed your shared code-snippet, we noted that the name for the series is not specified. We suggest setting a name for the series, as the legend will render by default when the series name is provided.


Code-snippet:


<ejs-chart id="container" width="60%">

     <e-series-collection>

         <e-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" name="Legend" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line"></e-series>

     </e-series-collection>

    

 </ejs-chart>


Screenshot:




Documentation: https://ej2.syncfusion.com/aspnetcore/documentation/chart/legend


Kindly revert us if you have any concerns.


Regards,

Nishanthi



Loader.
Up arrow icon