menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartIndicatorMacdLine - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartIndicatorMacdLine

    Provides the options to customize the MACD line of the indicator.

    Inheritance
    System.Object
    ChartSubComponent
    ChartIndicatorMacdLine
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartIndicatorMacdLine : ChartSubComponent, ISubcomponentTracker

    Constructors

    ChartIndicatorMacdLine()

    Declaration
    public ChartIndicatorMacdLine()

    Properties

    Color

    Gets or sets the color of the MACD line of the indicator.

    Declaration
    public string Color { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the color of the MACD line. The default is "#ff9933".

    Remarks

    Use valid hex or rgba CSS color strings for the color value. Configuring the color helps in visually distinguishing the MACD line from other chart elements.

    Examples
    // This example demonstrates how to macd line color of the indicator.
    <SfChart>
        <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime" IntervalType="IntervalType.Months">
        </ChartPrimaryXAxis>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@StockDetails" XName="X" YName="Y" Low="Low" High="High" Close="Close" Volume="Volume" Open="Open" Width="2" Name="Apple Inc" Type="ChartSeriesType.Candle" />
        </ChartSeriesCollection>
        <ChartIndicators>
            <ChartIndicator Type="TechnicalIndicators.Macd" Field="FinancialDataFields.Close" SeriesName="Apple Inc" Period="3">
                <ChartIndicatorMacdLine Color="navy" Width="2"></ChartIndicatorMacdLine>
            </ChartIndicator>
        </ChartIndicators>
    </SfChart>

    Width

    Gets or sets the width of the Macd line of the indicator.

    Declaration
    public double Width { get; set; }
    Property Value
    Type Description
    System.Double

    A System.Double representing the width of the MACD line. The default value is 2.

    Remarks

    Changing the width alters the thickness of the MACD line, which can enhance visibility in the chart.

    Examples
    // This example demonstrates how to macd line width of the indicator.
    <SfChart>
        <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime" IntervalType="IntervalType.Months">
        </ChartPrimaryXAxis>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@StockDetails" XName="X" YName="Y" Low="Low" High="High" Close="Close" Volume="Volume" Open="Open" Width="2" Name="Apple Inc" Type="ChartSeriesType.Candle" />
        </ChartSeriesCollection>
        <ChartIndicators>
            <ChartIndicator Type="TechnicalIndicators.Macd" Field="FinancialDataFields.Close" SeriesName="Apple Inc" Period="3">
                <ChartIndicatorMacdLine Color="navy" Width="2"></ChartIndicatorMacdLine>
            </ChartIndicator>
        </ChartIndicators>
    </SfChart>
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved