SfChart - Custom legend

Hi there,

to prettify my diagrams I use some gradiant area chart series along with bar and line-charts:

This chart consists of 7 chart-series

  • 4 line-charts which holds the information 
  • and 3 grey area charts for graphical purposes only

When I turn the legend on, all 7 chart series are listed although 3 of them (the grey ones) should not be part of the legend.


The challange is to hide chart-series in the legend, but still show it in the diagram?

Any idea?

Cheers,
Volker


3 Replies

DG Durga Gopalakrishnan Syncfusion Team June 28, 2021 03:35 AM UTC

Hi Volker,


We suggest you to not specify the Name for required series to hide that legend. We have prepared sample based on your requirement.


Code Snippet:


<SfChart>

    <ChartSeriesCollection>

        <ChartSeries Type="ChartSeriesType.Area"></ChartSeries>

        <ChartSeries Name="Line 1" Type="ChartSeriesType.Line"></ChartSeries>

    </ChartSeriesCollection>

    <ChartLegendSettings Visible="true"></ChartLegendSettings>

</SfChart>



Screenshot :


Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/HideLegend156512713.zip


Kindly revert us if you have any concerns.


Regards,

Durga G



VO Volker June 28, 2021 07:57 AM UTC

Hi Durga,

thank you for the help and the quick answer.


Cheers from Graz/Austria,
Volker



DG Durga Gopalakrishnan Syncfusion Team June 29, 2021 05:37 AM UTC

Hi Volker,


Most welcome. Please get back to us if you need any further assistance. We are always happy in assisting you.


Regards,

Durga G


Loader.
Up arrow icon