Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Chart X-Axis?

 Post Reply Post Reply
Author
Padureanu Dor Bujor View Drop Down
New Member
New Member
Avatar

Joined: 23 Jan 2012
Posts: 18
Post Options Post Options   Quote Padureanu Dor Bujor Quote  Post ReplyReply Direct Link To This Post Topic: Chart X-Axis?
    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.BeginUpdate;
  chartDrop.Chart.Series[0].ClearPoints;
  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));
    qMain.Next;
    Inc(i);
  end;
  chartDrop.EndUpdate;
-- 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).
 
tks
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.
Razvan
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3241
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 2013 at 8:56am
Hi, 

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.

example:

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

IWAdvChartView1.Chart.Series[0]

Kind Regards, 
Pieter
Back to Top
Padureanu Dor Bujor View Drop Down
New Member
New Member
Avatar

Joined: 23 Jan 2012
Posts: 18
Post Options Post Options   Quote Padureanu Dor Bujor Quote  Post ReplyReply Direct Link To This Post 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.
 
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3241
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post 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;
end;

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

Kind Regards, 
Pieter
Back to Top
Padureanu Dor Bujor View Drop Down
New Member
New Member
Avatar

Joined: 23 Jan 2012
Posts: 18
Post Options Post Options   Quote Padureanu Dor Bujor Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 2013 at 2:29am
it works ok.
tks for solutions.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down