# C1.Win.C1Chart.C1Chart.GenerateHistogramData

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_C1Chart_C1Chart_GenerateHistogramData_" data-uid="C1.Win.C1Chart.C1Chart.GenerateHistogramData*">GenerateHistogramData Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_C1Chart_C1Chart_GenerateHistogramData_" data-uid="C1.Win.C1Chart.C1Chart.GenerateHistogramData*"></a>
<h4 id="C1_Win_C1Chart_C1Chart_GenerateHistogramData_System_Double___System_Double___System_Double_System_Double____System_Double____System_Double____" data-uid="C1.Win.C1Chart.C1Chart.GenerateHistogramData(System.Double[],System.Double[],System.Double,System.Double[]@,System.Double[]@,System.Double[]@)">GenerateHistogramData(double[], double[], double, ref double[], ref double[], ref double[])</h4>
<div class="markdown level1 summary"><p>Generates histogram data from an array of raw data and the specified interval
boundaries.  Count normalization is performed by specifying an appropriate
NormalizationWidth.</p>
<p>Although the chart has a Histogram chart type, it is sometimes preferable
to generate charts similar to histograms, but with slightly different characteristics.
This method is provided as a convenience for these occasions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool GenerateHistogramData(double[] RawData, double[] Boundaries, double NormalizationWidth, ref double[] IntervalBounds, ref double[] IntervalCounts, ref double[] BoundaryIntervals)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GenerateHistogramData(RawData As Double(), Boundaries As Double(), NormalizationWidth As Double, ByRef IntervalBounds As Double(), ByRef IntervalCounts As Double(), ByRef BoundaryIntervals As Double()) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">RawData</span></td>
      <td><p>Specifies a double array containing data values.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">Boundaries</span></td>
      <td><p>Specifies the interval boundaries.  The boundaries
array is sorted internally, and duplication boundaries are eliminated.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">NormalizationWidth</span></td>
      <td><p>Specifies the interval width to be
used for normalization.  If less than or equal to zero, normalization is
not performed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">IntervalBounds</span></td>
      <td><p>A reference to a double array which will receive
the actual ordered and trimmed boundaries of the intervals making up the histogram.
This array is generated internally from the input Boundaries array.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">IntervalCounts</span></td>
      <td><p>A reference to a double array which will receive
the count of data points that fall into the interval specified by the
IntervalBounds array.  The IntervalCounts array will necessarily have one less element
than the IntervalBounds array.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">BoundaryIntervals</span></td>
      <td><p>A reference to a two element double array which will
receive the count of data points that fall outside the specified Boundaries array.  Element
zero (0) of the array receives the count of data points with values less than the lowest
value in the Boundaries array.  Element one (1) of the array receives the count of data points
with values greater than the highest value in the Boundaries array.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>A boolean indicating success or failure.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_C1Chart_C1Chart_GenerateHistogramData_System_Double___System_Double___System_Double_System_Double____System_Double____System_Double_____remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Each pair of consecutive interval boundary values is used to specify an
interval.  This results in one less interval than the number of boundary
points.  For example, boundaries of 1,3,4,5,6 would result in 4 intervals
of 1-3, 3-4, 4-5, and 5-6.  Note that each interval need not be the same
width.  When varying widths are specified in the IntervalBounds array, the
numeric counts are should be normalized by their area.  This means that an interval
with twice the width of another interval, but with the same number of data
points falling within it, will report half the returned count.</p>
</div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>Thrown when RawData or Boundaries are null.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
      <td><p>Thrown when RawData or Boundaries arrays are too short.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_C1Chart_C1Chart_GenerateHistogramData_" data-uid="C1.Win.C1Chart.C1Chart.GenerateHistogramData*"></a>
<h4 id="C1_Win_C1Chart_C1Chart_GenerateHistogramData_System_Double___System_Double_System_Double_System_Int32_System_Double_System_Double____System_Double____System_Double____" data-uid="C1.Win.C1Chart.C1Chart.GenerateHistogramData(System.Double[],System.Double,System.Double,System.Int32,System.Double,System.Double[]@,System.Double[]@,System.Double[]@)">GenerateHistogramData(double[], double, double, int, double, ref double[], ref double[], ref double[])</h4>
<div class="markdown level1 summary"><p>Generates histogram data from raw data and a series of interval boundaries
specified by a starting value, an interval width and the number of intervals.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool GenerateHistogramData(double[] RawData, double Start, double IncrementalWidth, int Count, double NormalizationWidth, ref double[] IntervalBounds, ref double[] IntervalCounts, ref double[] BoundaryIntervals)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GenerateHistogramData(RawData As Double(), Start As Double, IncrementalWidth As Double, Count As Integer, NormalizationWidth As Double, ByRef IntervalBounds As Double(), ByRef IntervalCounts As Double(), ByRef BoundaryIntervals As Double()) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">RawData</span></td>
      <td><p>Specifies a double array containing data values.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">Start</span></td>
      <td><p>Specifies the starting boundary of the first interval.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">IncrementalWidth</span></td>
      <td><p>Specifies the width of each interval.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">Count</span></td>
      <td><p>Specifies the number of consecutive, uniform width intervals.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">NormalizationWidth</span></td>
      <td><p>Specifies the interval width to be
used for normalization.  If less than or equal to zero, normalization is not performed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">IntervalBounds</span></td>
      <td><p>A reference to a double array which will receive
the actual ordered and trimmed boundaries of the intervals making up the histogram.
This array is generated internally from the input Boundaries array.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">IntervalCounts</span></td>
      <td><p>A reference to a double array which will receive
the count of data points that fall into the interval specified by the
IntervalBounds array.  The IntervalCounts array will necessarily have one less element
than the IntervalBounds array.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">BoundaryIntervals</span></td>
      <td><p>A reference to a two element double array which will
receive the count of data points that fall outside the specified Boundaries array.  Element
zero (0) of the array receives the count of data points with values less than the lowest
value in the Boundaries array.  Element one (1) of the array receives the count of data points
with values greater than the highest value in the Boundaries array.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>A boolean indicating success or failure.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_C1Chart_C1Chart_GenerateHistogramData_System_Double___System_Double_System_Double_System_Int32_System_Double_System_Double____System_Double____System_Double_____remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Each pair of consecutive interval boundary values is used to specify an
interval.  This results in one less interval than the number of boundary
points.  For example, if Start=1, IncrementalWidth=2 and Count=4, then
intervals bounded by 1,3,5,7,9 are created, resulting in 4 intervals of
1-3, 3-5, 5-7, and 7-9.</p>
<p>Since all intervals are of equal width, it is not necessary to perform
interval count normalization when only a single set of data is used.  However, if
multiple sets of data are used, and different interval widths are supplied,
normalization provides a more consistent result.</p>
</div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>Thrown when RawData is null.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
      <td><p>Thrown when the RawData array is too short.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
