# Hiding Legend

## Content



To programmatically hide the chart legend you can do the following:

Add name to the legend in xaml and then you can change its visibility in code: legend.Visibility = ...

```xml
<c1chart:C1Chart x:Name="chart" >
    <c1chart:C1ChartLegend x:Name="legend"  />
    ...
 </c1chart:C1Chart>
```

## See Also

[Changing the Legend Orientation and Position](/componentone/docs/wpf/online-chart/overview/ChartFeatures/chart-legend/ChangingOrientationPosition)