Recent

Author Topic: [SOLVED] Box-and-whisker plot hint  (Read 227 times)

apeoperaio

  • Sr. Member
  • ****
  • Posts: 291
[SOLVED] Box-and-whisker plot hint
« on: November 13, 2025, 11:16:16 am »
I am trying to use the hint when dealing with Box and whiskers plot.
I am using the chart tool TDataPointHintTool (marks as smsValue). The hint is shown when I move the mouse on the box and whiskers plot, but the value is always the Min value of the serie.

Attached you can find a project to replicate this behaviour.

Is it a bug?
« Last Edit: November 13, 2025, 03:40:54 pm by apeoperaio »

wp

  • Hero Member
  • *****
  • Posts: 13277
Re: Box-and-whisker plot hint
« Reply #1 on: November 13, 2025, 11:57:57 am »
I committed a fix to this so that the correct y (and/or x) value of a multi-valued chartsource is picked by default. But even without this, you can provide a handler for the OnHint event of the TDataPointHintTools to compose the hint text on your own:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.ChartToolset1DataPointHintTool1Hint(ATool: TDataPointHintTool;
  2.   const APoint: TPoint; var AHint: String);
  3. var
  4.   ser: TBoxAndWhiskerSeries;
  5. begin
  6.   if ATool.Series is TBoxAndWhiskerSeries then
  7.   begin
  8.     ser := TBoxAndWhiskerSeries(ATool.Series);
  9.     AHint := ser.FormattedMark(ATool.PointIndex, ser.Marks.Format, ATool.YIndex);
  10.   end;
  11. end;
Here you can also use the Marks.Format property to define the number of decimal places displayed, e.g.: BoxAndWhiskerSeries1.Marks.Format := '%0:.2f'.

apeoperaio

  • Sr. Member
  • ****
  • Posts: 291
Re: Box-and-whisker plot hint
« Reply #2 on: November 13, 2025, 03:40:35 pm »
Thank you.
Really helpful and superfast!

 

TinyPortal © 2005-2018