I have some data which just came into our software that happens to have 5 digits in the axis labels (it used to be no more than 4). Apparently, the axis labels are now being drawn over the axis title. Is there a way to increase the size of the margin area where the title is drawn so that this doesn't occur? I would really like this to be automatically calculated. I'm not using any custom axes or anything.
Here is the right side of my graph:
Regards,
Brigg Thorp
Senior Software Engineer
Timex Corporation
Axis Title overwritten by Axis Labels
Hi Brigg,
yes, you can increase the Axis label size using the following code :
yes, you can increase the Axis label size using the following code :
Code: Select all
Private Sub TChart1_OnAfterDraw()
TChart1.Axis.Left.Labels.Size = TChart1.Axis.Left.Labels.MaxWidth
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com
Still having an issue
I tried your solution and it only seems to work after I perform a zoom (using the mouse). The initial painting of the graph still has this problem. Is there a way to force the axes labels to update after I have added all the series data to the graph?
I'm also setting the labes.size as mentioned above in my code just after the series data is added. It doesn't seem to update from the OnAfterDraw event. Any additional information you could provide would be very helpful.
Regards,
Brigg Thorp
Senior Software Engineer
Timex Corporation
I'm also setting the labes.size as mentioned above in my code just after the series data is added. It doesn't seem to update from the OnAfterDraw event. Any additional information you could provide would be very helpful.
Regards,
Brigg Thorp
Senior Software Engineer
Timex Corporation
Hi,
have you tried adding tChart1.Environment.Internal repaint to force to repaint after the Chart has been populated ?
have you tried adding tChart1.Environment.Internal repaint to force to repaint after the Chart has been populated ?
Pep Jorge
http://support.steema.com
http://support.steema.com
Another problem with the axis labels
One of our software testers just noticed another issue. If they resize my application, the axis labels change from integers (1,2, 3, etc.) to floating point numbers with one digit (1.5, 2, 2.5, 3, etc.) when there is enough space on the graph to draw them.
When the user resizes my app, I don't redraw the whole graph, because it's a lot of data coming from an Access database.
I tried adding your suggestion to the Form_resize event and it doesn't help. This is the code I used:
This doesn't seem to help. Is there anything else I need to do to move the axis labels if the labels increase in width?
When the user resizes my app, I don't redraw the whole graph, because it's a lot of data coming from an Access database.
I tried adding your suggestion to the Form_resize event and it doesn't help. This is the code I used:
Code: Select all
With TChart3
.Axis.Left.Labels.Size = TChart3.Axis.Left.Labels.MaxWidth
.Axis.Right.Labels.Size = TChart3.Axis.Right.Labels.MaxWidth
.Environment.InternalRepaint
.Repaint
End With
Hi Brigg,
placing the code in the OnBeforeDrawAxes should do the trick.
placing the code in the OnBeforeDrawAxes should do the trick.
Pep Jorge
http://support.steema.com
http://support.steema.com