Back to Devexpress

DxBarGaugeLegendSettings Class

blazor-devexpress-dot-blazor-ee9f81c3.md

latest6.2 KB
Original Source

DxBarGaugeLegendSettings Class

Contains settings for the Bar Gauge‘s legend.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public class DxBarGaugeLegendSettings :
    LegendBaseSettings<DxBarGaugeLegendSettings, BarGaugeLegendSettingsModel>,
    IModelProvider<TextFormatSettingsModel>

Remarks

Use the DxBarGaugeLegendSettings component to configure legend settings for the DxBarGauge component.

Show Nested Component Structure

To display a legend, add a DxBarGaugeLegendSettings object to the bar gauge markup and enable the Visible property.

Component-Level Settings

The DxBarGaugeLegendSettings component allows you to specify the following properties at the component level:

HorizontalAlignment | VerticalAlignmentPosition the legend in the bar gauge.PaddingLeftRight | PaddingTopBottomAllow you to adjust paddings between edges and content in the legend.Orientation | ColumnCount | ColumnSpacing | RowCount | RowSpacing | ItemTextPositionSpecify the layout and arrangement of legend items.BackgroundColorAllows you to change the legend’s background color.MarkerSizeSpecifies the size of legend item markers.

Nested Objects

In addition to component-level settings, you can also add the following objects to DxBarGaugeLegendSettings markup:

DxLegendTitleSettings | DxLegendSubtitleSettingsImplement the legend’s title and subtitle.DxFontSettings | DxTextFormatSettingsContain font and format settings for legend item captions.DxBorderSettingsConfigures legend borders.DxMarginSettingsSpecifies legend margins.

Example

The following code snippet adds a legend to the DxBarGauge component and configures legend settings:

razor
<DxBarGauge Width="100%"
            Height="500px"
            StartValue="0"
            EndValue="100"
            Values="@Values">
    <DxBarGaugeLegendSettings Visible="true"
                              ItemCaptions="@LegendItemCaptions"
                              VerticalAlignment="VerticalEdge.Bottom"
                              HorizontalAlignment="HorizontalAlignment.Center">
        <DxLegendTitleSettings Text="Series">
            <DxFontSettings Color="purple" Weight="700" />
        </DxLegendTitleSettings>
        <DxBorderSettings Visible="true" Color="purple" />
        <DxFontSettings Weight="300" />
        <DxMarginSettings Top="30" />
    </DxBarGaugeLegendSettings>
    @* ... *@
</DxBarGauge>

@code {
    double[] Values = new double[] { 47.27, 65.32, 84.59, 81.86, 99 };
    string[] LegendItemCaptions = new string[] { "Metacritic", "Ratingraph.com", "Rotten Tomatoes", "IMDb", "TV.com" };
}

Implements

IComponent

IHandleEvent

IHandleAfterRender

IDisposable

Inheritance

Object ComponentBase DxSettingsComponent<DevExpress.Blazor.ClientComponents.Internal.BarGaugeLegendSettingsModel> DxComplexSettingsComponent<DxBarGaugeLegendSettings, DevExpress.Blazor.ClientComponents.Internal.BarGaugeLegendSettingsModel> LegendBaseSettings<DxBarGaugeLegendSettings, DevExpress.Blazor.ClientComponents.Internal.BarGaugeLegendSettingsModel> DxBarGaugeLegendSettings

See Also

DxBarGaugeLegendSettings Members

DevExpress.Blazor Namespace