Print Page | Close Window

Chart X-Axis?

Printed From: TMS Software
Category: IntraWeb Components
Forum Name: IW Charts
Forum Discription:
Printed Date: 14 Dec 2019 at 1:21am

Topic: Chart X-Axis?
Posted By: Padureanu Dor Bujor
Subject: Chart X-Axis?
Date Posted: 04 Mar 2013 at 3:35am
Hello all
I have the following problems with TTIWAdvChart, in Delphi XE2.
1. X-Axis
I put on a intraweb form one TTIWAdvChart.
On design time I tried (with no succes) to enlage the chart to get more than 10 points on X-Axis.
I need to put 12 monts on x axis and I only get 11. :(
basicaly what I'm doing is the following
-- some code here
  chartDrop.Chart.Series[0].LegendText := IntToStr(firstYear);
  while not qMain.Eof do begin
    chartDrop.Chart.Series[0].AddSinglePoint(qMain.FieldByName('SUMDROPVALUE').AsFloat, GetMonthStringByInteger(qMain.FieldByName('OUT_MONTH').AsInteger));
-- additonal code not chart
and the same code for series 1 and 2.
-- end
The query always has 12 records. and the chart receive all the 12 months but only display 11.
I need some advice in how to fix this. design time or run time
2. on the same chart I dont want to display the y position (values) on the Y-Axis. Instead I want to display a value near the XY point. (the qMain.FieldByName('SUMDROPVALUE').AsFloat) Value.
basicaly the Y axis to be clear of values and the chart itself to have this values  (the users ask for this).
PS. can you point me some examples?
What I found so far on the site is not enough for me at least :). I learn better from examples.

Posted By: Pieter Scheldeman
Date Posted: 04 Mar 2013 at 8:56am

1) You need to change the range to the record count with
chartDrop.Chart.RangeTo := 12;

2) Unfortunately that is not possible, The Y-Axis can be disabled but is not able to display an empty rectangle which supports custom drawing to draw the custom XY values.

There are some samples available in VCL that can be translated to Intraweb. The code should be similar except for multi-pane support which isn't available in the IntraWeb Chart.


AdvChartView1.Panes[0].Series[0] to


Kind Regards, 

Posted By: Padureanu Dor Bujor
Date Posted: 04 Mar 2013 at 10:02am
tks for point 1. Is working ok.
but for point 2... I dont want to disable the Y only not to display the text. :)
I cannot properly see the text because of limited form space.

Posted By: Pieter Scheldeman
Date Posted: 04 Mar 2013 at 11:16am
You can perhaps override the OnYAxisGetValue per serie and return an empty value to clear
you can also override the OnYAxisDrawValue to draw custom values at the tickmarks

  AdvChartView1.Panes[0].Series[0].OnYAxisGetValue := YAxisGetVal;

procedure TForm856.YAxisGetVal(Sender: TObject; Serie: TChartSerie;
  Value: double; var AValue: string);
  AValue := '';

Kind Regards, 

Posted By: Padureanu Dor Bujor
Date Posted: 05 Mar 2013 at 2:29am
it works ok.
tks for solutions.

Print Page | Close Window