Hello
I have attached a PDF, that shows the acutal print out of my gant graphic.
The bottom axis shows the date of the gant data. I try to show also the top axis with the week number of the year, assigned to the gant data. But i don't have any idea where i have to start with programming.
Also does i have the problem, that the text are not realy clear (pixels) at the print out and the allignment are should be left!
May somebody have my a hint.
Thanks
Gregor
Top Axis with Gant graphic
Top Axis with Gant graphic
- Attachments
-
- Aufnahme3.jpg (367.23 KiB) Viewed 8164 times
Re: Top Axis with Gant graphic
Hi Gregor,
Since there's no formatdatetime to show the week number of the year, you should use OnGetAxisLabel event to format the string manually. Ie:
- Printing resolution. Take a look at the printing better article here.
- Alignment. I'm not sure to understand what doesn't look as you'd expect. Could you please expand? Note an sscce helps to easily understand and reproduce the problems.
You should assign both axes to your series to make them visible.viper wrote:The bottom axis shows the date of the gant data. I try to show also the top axis with the week number of the year, assigned to the gant data. But i don't have any idea where i have to start with programming.
Code: Select all
Series1.HorizAxis:=aBothHorizAxis;
Code: Select all
uses DateUtils;
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.HorizAxis:=aBothHorizAxis;
Chart1.Axes.Top.Increment:=DateTimeStep[dtOneWeek];
Chart1.OnGetAxisLabel:=Chart1GetAxisLabel;
end;
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis; Series: TChartSeries;
ValueIndex: Integer; var LabelText: string);
var tmpDate: TDateTime;
begin
if (Sender = Chart1.Axes.Top) and (LabelText<>'') then
begin
tmpDate:=StrToDateTime(LabelText);
LabelText:=IntToStr(WeekOf(tmpDate));
end;
end;
We should differentiate:viper wrote:Also does i have the problem, that the text are not realy clear (pixels) at the print out and the allignment are should be left!
- Printing resolution. Take a look at the printing better article here.
- Alignment. I'm not sure to understand what doesn't look as you'd expect. Could you please expand? Note an sscce helps to easily understand and reproduce the problems.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Top Axis with Gant graphic
Hello Yeray
Thank you for your fast respons and answer. I could solve my problem with the calendar number and printout resolution.
Now it just left the problem with the alligment of the text (Gant) at the left side.
When you take a look at my printout example, the text for the gant are center alligned. But i try to allign it left, but i can't find the responsible property.
Best Regards
Gregor
Thank you for your fast respons and answer. I could solve my problem with the calendar number and printout resolution.
Now it just left the problem with the alligment of the text (Gant) at the left side.
When you take a look at my printout example, the text for the gant are center alligned. But i try to allign it left, but i can't find the responsible property.
Best Regards
Gregor
Re: Top Axis with Gant graphic
Hi Gregor,
I'm glad to hear you found how to make it work as you wish.viper wrote:Thank you for your fast respons and answer. I could solve my problem with the calendar number and printout resolution.
Try with this:viper wrote:Now it just left the problem with the alligment of the text (Gant) at the left side.
When you take a look at my printout example, the text for the gant are center alligned. But i try to allign it left, but i can't find the responsible property.
Code: Select all
Chart1.Axes.Left.Items.Format.TextAlignment:=taLeftJustify;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Top Axis with Gant graphic
Hello Yeray
Thanks, you Tip works perfect.
Gregor
Thanks, you Tip works perfect.
Gregor