Accord.Controls.HistogramView.UpdateGraph C# (CSharp) Method

UpdateGraph() public method

Forces a update of the Histogram bins.
public UpdateGraph ( string title = "Histogram" ) : void
title string
return void
        public void UpdateGraph(string title = "Histogram")
        {
            graphBars.Clear();

            String[] labels = new String[histogram.Values.Length];
            for (int i = 0; i < histogram.Values.Length; i++)
            {
                graphBars.AddPoint(i, histogram.Bins[i].Value);
                labels[i] = histogram.Bins[i].Range.Min.ToString(formatString, CultureInfo.CurrentCulture) +
                    " - " + histogram.Bins[i].Range.Max.ToString(formatString, CultureInfo.CurrentCulture);
            }

            zedGraphControl.GraphPane.Title.Text = title;
            zedGraphControl.GraphPane.XAxis.Scale.TextLabels = labels;
            zedGraphControl.GraphPane.XAxis.Scale.FontSpec.Angle = 45.0f;

            zedGraphControl.AxisChange();
            zedGraphControl.Invalidate();
        }