About normalCurve of histogram

Posted by: toynnus on 4 February 2021, 8:39 pm EST

    • Post Options:
    • Link

    Posted 4 February 2021, 8:39 pm EST

    dear GrapeCity team.

    I drawing a histogram using the c1 chart.(not a flex chart).

    It is easy to express Bell Curve with flex chart.

        Dim histogramSeries = New C1.Win.Chart.RangedHistogram
        histogramSeries.Name = "Frequency"
    
        histogramSeries.BinMode = C1.Chart.HistogramBinning.NumberOfBins
        histogramSeries.NumberOfBins = 5
    
    
        'Bell Curve
        Dim histogramSeries2 = New C1.Win.Chart.Histogram
        histogramSeries2.NormalCurve.Visible = True
    
        histogramSeries2.NormalCurve.LineStyle = New C1.Win.Chart.ChartStyle With {
        .StrokeColor = Color.Blue,
        .StrokeWidth = 1
         }
        Chart2.Series.Add(histogramSeries)
        Chart2.Series.Add(histogramSeries2)
    

    =================================================

    How can I apply the same to the c1 chart?

    thank you.

  • Posted 5 February 2021, 3:23 am EST

    Hi Sungtae,

    You can display the Normal Curve for Histogram in C1Chart by setting Histogram’s NormalDisplay Visible property to true as follows:

    
    c1Chart1.ChartGroups[1].Histogram.NormalDisplay.Visible = true;
    
    

    You may also refer to the same from the ‘Histogram’ product sample present at location Documents\ComponentOne Samples\WinForms\v4.5.2\Charts\CS\Histogram

    Best Regards,

    Kartik

  • Posted 7 February 2021, 8:44 am EST

    I know it.

    But it doesn’t show the normal distribution over the actual data.

    It just shows up in the center.

  • Posted 8 February 2021, 8:00 am EST

    Hi Sungtae,

    The normal curve available with C1Chart is just for comparison of the histogram to the normal (Gaussian) distribution and also it is not related to the data. So, I am sorry to inform you that your requirement can’t be implemented with C1Chart.

    However, later this feature (Normal Curve related to data) was added to the FlexChart and hence you are able to accomplish your requirement with FlexChart. Since, FlexChart is our latest charting control so I would request you to use FlexChart instead.

    Best Regards,

    Kartik

  • Posted 8 February 2021, 8:02 pm EST

    Inevitably, I have to draw using the c1 chart. Is there any way (by version problem)? Thank you for sending us an example source or link for reference.

  • Posted 9 February 2021, 2:56 am EST

    Hi Sungtae,

    One way of doing this is manually calculating the normal distribution (bell curve coordinates) based on your data and then plotting it as a Spline series on C1Chart.

    Regards,

    Kartik

Need extra support?

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

Learn More

Forum Channels