Forum > TAChart

Ticks pen width

(1/1)

prema:
Hi everyone,

I would like to adjust the thickness of the ticks on the axis, but I'm not able to find the way. The length is possible to adjust by the TickLength or TickInnerLength. But I didn't find the way how to increase the thickness. For example if I put the AxisPen.Width := 2; then thickness of the ticks stay with width 1 what doesn't look good.

I also tried to adjust directly Chart.Drawer.SetPenWidth, but withou success. From what property the width of the ticks is taken? Thanks for help.

With best regards

Premek

wp:
No, whatever you do the tick penwidth is reset to 1 immediately before drawing the ticks. The only way to interfere would be to write a descendant of the drawer class and override its PrepareSimplePen method in which this happens. But this would have many sideeffects because this method is used at several places.

I think it's better to add a new property TickWidth. Should both kinds of ticks, inner and outer, have the same width?

prema:
Thank you for quick answer.

I think that all minor/major, inner/outer ticks can have the same width. On the other hand instead of having the new property, I think that the pen for ticks can be the same as the one for AxisPen. When I change the color or width of the axis the ticks go with it.

Thanks once more

Premek

wp:
Added a new property TickWidth (default 1) to major and minor axes. It is available in Laz/main (trunk); being a new feature it will not make it into the upcoming v2.2 shortly before its release.

prema:
Good job. Thanks a lot. I will wait for it release.

For now I just did some workaround to put

FDrawer.SetPenWidth(FAxis.Grid.Width);

into the TAxisDrawHelper.DrawMark procedure just before to draw the ticks and labels. I don't use the grid, so I just use the grid pen width property to adjust the desired ticks pen.

Premek

Navigation

[0] Message Index

Go to full version