Page 1 of 1

reading values from THistogramFunction

Posted: Wed Jun 23, 2010 11:00 am
by 10545706
I can't figure out how to read the calculated values from a histogram. The following would loop through each bin

Code: Select all

for( int j = 0; j < dynamic_cast< THistogramFunction * >( c -> Series[ 1 ] -> FunctionType ) -> NumBins; j ++ )
   ?????;
but how do i now read the function's values using index j? In ChartEditor, the desired column is headed 'Bar' when viewing the series.

Re: reading values from THistogramFunction

Posted: Wed Jun 23, 2010 11:52 am
by narcis
Hi philip,

You can retrieve function series values, for example:

Code: Select all

  for i:=0 to (Chart1[1].FunctionType as THistogramFunction).NumBins -1 do
  begin
    BinVal:=Chart1[1].YValue[i];
  end;
Code below does the same but is simpler:

Code: Select all

  for i:=0 to Chart1[1].Count -1 do
  begin
    BinVal:=Chart1[1].YValue[i];
  end;
Hope this helps!