Hello together,
my program (c++ with teechart Activex) produces a contour plot from a huge xyz-array. I try to show the user these values if he click on the chart at runtime.
For 2d-series I do this with the event OnClickSeries(...), but it does not work with contour plots.
Could anyone explain me, how I could do this?
Regards
Raimund
How to get xyz-Values from contour plots?
Re: How to get xyz-Values from contour plots?
Hi Raimund,
I've made a simple example in VB6 to check this:
And I've also made the same example in Delphi using TeeChart VCL (note TeeChart ActiveX is a wrapper from the VCL version):
I see the event is fired when you click on the levels, not when you click on the filled area.
How would you expect it to work?
I've made a simple example in VB6 to check this:
Code: Select all
Private Sub Form_Load()
TChart1.Header.Text.Clear
TChart1.Header.Text.Add TChart1.Version
TChart1.Aspect.View3D = False
TChart1.AddSeries scContour
TChart1.Series(0).FillSampleValues
TChart1.Series(0).Marks.Visible = True
TChart1.Series(0).Marks.Transparent = True
TChart1.Series(0).asContour.Filled = False
End Sub
Private Sub TChart1_OnClickSeries(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If (SeriesIndex >= 0) And (TChart1.SeriesCount > 0) And (TChart1.Series(SeriesIndex).Count > 0) And (ValueIndex >= 0) Then
Caption = Format$(TChart1.Series(SeriesIndex).asContour.Levels.Items(ValueIndex).UpToValue, "#0.###")
End If
End Sub
Code: Select all
uses TeeSurfa;
var Chart1: TChart;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1:=TChart.Create(Self);
Chart1.Parent:=Self;
Chart1.Align:=alClient;
Chart1.View3D:=false;
with Chart1.AddSeries(TContourSeries) as TContourSeries do
begin
FillSampleValues;
Marks.Visible:=true;
OnClick:=ContourOnClick;
end;
end;
procedure TForm1.ContourOnClick(Sender:TChartSeries; ValueIndex:Integer; Button:TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if (Sender<>nil) And (Sender.Count > 0) And (ValueIndex >= 0) Then
Caption := 'Index: ' + IntToStr(ValueIndex) + ', Level: ' + FormatFloat( '#0.###', (Sender as TContourSeries).Levels.Items[ValueIndex].UpToValue);
end;
How would you expect it to work?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: How to get xyz-Values from contour plots?
Hi Yeray,
OnClickSeries(...) only works, if I click on the countour line. My contour plot ist filed without drawn contour lines. I need the values also if the user clicks between two contour lines.
Regards
Raimund
OnClickSeries(...) only works, if I click on the countour line. My contour plot ist filed without drawn contour lines. I need the values also if the user clicks between two contour lines.
Regards
Raimund
Re: How to get xyz-Values from contour plots?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |