views:

807

answers:

2

I am using a TChart in Delphi 7, and I want to display some bar charts. I am using the following code to set up the series values from a database query:

  chart1.FreeAllSeries;

  chart1.SeriesList.Clear;

  chart1.AddSeries(TBarSeries.Create(Self));
  TBarSeries(chart1.Series[0]).BarStyle:=bsRectGradient;

  with query1 do
    begin
      Close;
      Execute;

      while not EoF do
        begin
          chart1.Series[0].Add(FieldAsFloat('sum_actual_days'), FieldAsString('contract_no'));
          Next;
        end;

    end;

Each bar (value) is now showing the label both below the bar, and in a yellow rectangle above the bar.

Instead of repeating the label value twice, I have some additional information from the query that I would like to show above the bar instead of the label (or, preferably, as a mouseover hint). Can this be done with the TChart? And how... ?

A: 

There is the "Mark Tips" tool that allows you to show a hint when you move over a bar. But I'm not sure if you can modify the tip to show custom data instead of the predifined styles.

The_Fox
+1  A: 
Dave Elsberry