1

Using Delphi Seattle and the TChart component for iOS/Android, I have a bar series chart. Is there an easy way, so that when I click on a bar, a popup/legend/callout shows on top of the bar with the exact value?

I've come across the ClickSeries event but is there an easier way/more logical way to do this without having to recreate a callout from this event every single time? I've also noticed that when I add code to this series ( for testing, I did a single showmessage(inttostr(valueindex)). In addition, a red border appears whenever the mouse down event is fired.

Assuming ( if it's available ) that there is an easy way to both change this border to per se blue instead of red, and also show the callout automatically when clicking, where in the TChart Editor in the IDE is this possible?

From the chart Editor, I've tried going to Series -> General -> hover, but nothing here gets my desired effects.

UPDATE: This is what I've come up with after dinking around with everything. I can show/hide the callout as originally wanted, but still can't figure out how to modify the red border that appears. The text for callout now appears red as well when the mousedown event is triggered.

procedure TmTestForm.RawDataSeriesAfterAdd(Sender: TChartSeries;
  ValueIndex: Integer);
begin
  RawDataSeries.Marks.Item[ValueIndex].Visible:=false;
end;

procedure TmTestForm.RawDataChartClickSeries(Sender: TCustomChart;
  Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if Series.Marks.Item[ValueIndex].Visible=TRUE then
    Series.Marks.Item[ValueIndex].Visible:=FALSE
  else
    Series.Marks.Item[ValueIndex].Visible:=TRUE;
end;
ThisGuy
  • 1,405
  • 1
  • 24
  • 51

0 Answers0