Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1274 - [TV52014696] A customer proposed an override of the event OnDraxAxisLabel: now: ...
Summary: [TV52014696] A customer proposed an override of the event OnDraxAxisLabel: no...
Status: CONFIRMED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Axis (show other bugs)
Version: unspecified
Hardware: All All
: High enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-24 13:10 EST by yeray alonso
Modified: 2015-08-19 05:02 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2015-08-18 06:40:32 EDT
A customer proposed an override of the event OnDraxAxisLabel:
now:
procedure OnDrawAxisLabel(Sender:TChartAxis; var X,Y,Z:Integer; var Text:String; var DrawLabel:Boolean);
proposed:
procedure OnDrawAxisLabel(Sender:TChartAxis; var X,Y,Z:Integer; var Text: string; const aValueOfTick: Float; var DrawLabel:Boolean);
"This will make it easier for me than converting a string to a float or a datestring to a float. I know that not all series have a value of a tick but those axis that have this information it would be much faster and easier to rearrange labels."
Forum discussion:
http://www.teechart.net/support/viewtopic.php?f=3&t=10785&view=unread#unread [created:2010-02-24T14:10:18.000+02:00 reported by:yeray reported in version:9.0 (TeeChart VCL)]
Comment 1 yeray alonso 2015-08-18 07:04:19 EDT
Another customer suggests us to have an extra event instead of changing the actual OnGetAxisLabel:

"In case changing the existing callback is problematic due to compatibility reasons, an alternative might be to provide an additional one, such as shown below?

Function TChartAxis.LabelValue(Const Value:Double):String;
var tmp : String;
Begin
  ///////////////////////////////////////////////////////////////
  if Assigned(ParentChart.FOnGetCustomAxisLabel) then
     Result := ParentChart.FOnGetCustomAxisLabel(TChartAxis(Self), Value)
  ///////////////////////////////////////////////////////////////
  else
  begin
  if IAxisDateTime then
  begin
    if FDateTimeFormat='' then tmp:=DateTimeDefaultFormat(IRange)
                          else tmp:=FDateTimeFormat;

    DateTimeToString(result,tmp,Value);
  end
  else
    result:=FormatFloat(FAxisValuesFormat,Value);

  if Assigned(ParentChart.FOnGetAxisLabel) then
     ParentChart.FOnGetAxisLabel(TChartAxis(Self),nil,-1,Result);

  if FLabels.MultiLine then
     result:=ReplaceChar(result,' ',TeeLineSeparator);
  end;
end;"

http://www.teechart.net/support/viewtopic.php?p=69719&#p69719