Tips and Frequently Asked Questions
Add custom X-axis values via an event
To override the standard X-axis values drawn by TAdvChartView an event OnXAxisDrawValue event is available for each serie. To add an event handler for OnXAxisDrawValue, declare a procedure and assign it to the serie.OnXAxisDrawValue event like in the code snippet below:
AdvChartView.Panes[0].Series[0].OnXAxisDrawValue := XAxisDrawValue; procedure TForm.XAxisDrawValue(Sender: TObject; Serie: TChartSerie; Canvas: TCanvas; ARect: TRect; ValueIndex, XMarker: integer; Top: Boolean; var defaultdraw: Boolean); begin //Insert Code here end;
The technique illustrated with following sample. Some points were added in a serie and for each odd value on the X-Axis we want to display a Car brand in the X-axis:
procedure TForm.XAxisDrawValue(Sender: TObject; Serie: TChartSerie; Canvas: TCanvas; ARect: TRect; ValueIndex, XMarker: integer; Top: Boolean; var defaultdraw: Boolean); const lst: array[0..4] of String = ('Audi', 'BMW', 'Mercedes', 'Bugatti', 'Porsche'); var s: String; th, tw: integer; begin if Odd(ValueIndex) then begin Canvas.Font.Size := 12; s := lst[Random(Length(lst))]; th := Canvas.TextHeight(s); tw := Canvas.TextWidth(s); Canvas.TextOut(Xmarker - (tw div 2), ARect.Top + th, s); end; end;
Pricing
Single Developer License
Small Team License
Site License
TMS VCL Chart
€ 125
€
70
yearly renewal
license for 1 developer
MOST POPULAR
BEST VALUE
All prices excl. VAT. Renewal price is subject to change and only valid up to 30 days after license has expired. After renewal period a discount price is offered to renew the license.