reading values from THistogramFunction

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
philip
Newbie
Newbie
Posts: 15
Joined: Tue Jun 26, 2007 12:00 am

reading values from THistogramFunction

Post by philip » Wed Jun 23, 2010 11:00 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: reading values from THistogramFunction

Post by Narcís » Wed Jun 23, 2010 11:52 am

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!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply