Forum > TAChart

[SOLVED] Box-and-whisker plot hint

(1/1)

apeoperaio:
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?

wp:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.ChartToolset1DataPointHintTool1Hint(ATool: TDataPointHintTool;  const APoint: TPoint; var AHint: String);var  ser: TBoxAndWhiskerSeries;begin  if ATool.Series is TBoxAndWhiskerSeries then  begin    ser := TBoxAndWhiskerSeries(ATool.Series);    AHint := ser.FormattedMark(ATool.PointIndex, ser.Marks.Format, ATool.YIndex);  end;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:
Thank you.
Really helpful and superfast!

Navigation

[0] Message Index

Go to full version