NormalCurve color

Posted by: toynnus on 27 May 2020, 12:41 am EST

    • Post Options:
    • Link

    Posted 27 May 2020, 12:41 am EST

    hello.

    I used flex chart on c1.

    I want to line color of NormalCurve but error occurs.

    can you help me?

    Dim histogramSeries = New C1.Win.Chart.Histogram()
        histogramSeries.Name = "Frequency"
        histogramSeries.Binding = "X"
    
        histogramSeries.NormalCurve.Visible = True
        histogramSeries.NormalCurve.LineStyle.FillColor = Color.Blue
        histogramSeries.NormalCurve.LineStyle.StrokeColor = Color.Blue
        Chart2.Series.Add(histogramSeries)
    
  • Posted 27 May 2020, 8:23 pm EST

    Hi,

    The Style/LineStyle for a Series/HistogramSeries is null/Nothing by default. Therefore accessing a property (StrokeColor/FillColor) on a null object will throw NullReferenceException. Rather you should set the ChartStyle object for LineStyle as follows:

    histogramSeries.NormalCurve.LineStyle = New ChartStyle With {
        .StrokeColor = Color.Blue,
        .StrokeWidth = 2
    }
    

    Just for your information, since it’s a curve therefore setting FillColor will not make any difference.

    Regards,

    Basant

  • Posted 28 May 2020, 1:42 am EST

    Thank you so much!!! good.~~

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels