Hi,
Our .NET Graph component Y-Axis label texts were clipping when Multiple Axises were available and label text has large numbers e.g. 100.000
To fix this issue we have provided option for user to increase Left Margin (Minimum by 3% & Maximum by 50%).
The issue we are facing is the - after the Left Margin size changes the Y-Axises are not getting positioned with equal distance in Left Margin. Instead they are getting aligned to right side with some width and left most area is blank.
We tried setting RelativePosition for Y-Axis but it didn't worked.
Kindly suggest us a way to handle the issue.
Let us know better way to align Y-Axises so that text don't get clipped or guide us to equally distribute Y-Axises in Left Margin so that text won't get clipped.
Thanks.
How to distribute y-Axises equally in Left Margin
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to distribute y-Axises equally in Left Margin
Hello,
Custom axes do not automatically reposition on every Chart repaint, for example when you cause a repaint by resetting the MarginLeft property. This means that the custom axes positions have to be calculated for each repaint, something you can achieve in one of the Canvas paint events:
Custom axes do not automatically reposition on every Chart repaint, for example when you cause a repaint by resetting the MarginLeft property. This means that the custom axes positions have to be calculated for each repaint, something you can achieve in one of the Canvas paint events:
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: How to distribute y-Axises equally in Left Margin
Hi,
Thank you for your suggestion.
But we are not able to set Relative Position in any of the said events.
Thus we are trying to set it using some of our calculations as below. But it is not working accurately.
we are worried about this calculation:
tChart1.Axes.Custom.RelativePosition = marginIntervalInPecent * -(index) * (100 / tChart1.Panel.MarginLeft);
Please suggest a way to set Relative Position properly.
Thank you for your suggestion.
But we are not able to set Relative Position in any of the said events.
Thus we are trying to set it using some of our calculations as below. But it is not working accurately.
Code: Select all
double leftMarginWidthInPixels = (tChart1.Chart.Width * tChart1.Panel.MarginLeft) / 100;
double marginIntervalInPixels = leftMarginWidthInPixels / yAxisCount;
double marginIntervalInPecent = (marginIntervalInPixels / leftMarginWidthInPixels) * tChart1.Panel.MarginLeft;
int index = 0;
for (int i = 0; i < tChart1.Axes.Custom.Count; i++)
{
tChart1.Axes.Custom[i].RelativePosition = marginIntervalInPecent * -(index) * (100 / tChart1.Panel.MarginLeft);
index++;
}
tChart1.Axes.Custom.RelativePosition = marginIntervalInPecent * -(index) * (100 / tChart1.Panel.MarginLeft);
Please suggest a way to set Relative Position properly.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to distribute y-Axises equally in Left Margin
Hello,
You might like to try the PlaceAxis code shown in this message here. If that does not fulfil your requirements, please let me know.
You might like to try the PlaceAxis code shown in this message here. If that does not fulfil your requirements, please let me know.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: How to distribute y-Axises equally in Left Margin
HI,
Thank you for your reply.
But the suggested solution is not working for us.
We already have chart and allowing user to specify Left Margin using Numeric Up-Down and on this Numeric Up-Down value change want to set Relative position of each series.
Chart.Draw() we don't want to call.
Is it mandatory to call Chart.Draw()?
Please suggest some calculations with which we can achieve it.
Thanks.
Thank you for your reply.
But the suggested solution is not working for us.
We already have chart and allowing user to specify Left Margin using Numeric Up-Down and on this Numeric Up-Down value change want to set Relative position of each series.
Chart.Draw() we don't want to call.
Is it mandatory to call Chart.Draw()?
Please suggest some calculations with which we can achieve it.
Thanks.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to distribute y-Axises equally in Left Margin
I have already suggested some calculations to use, but without a much clearer idea of what you are trying to achieve I am unable to provide you with anything further. To that extent, would you please be so kind as to provide us with a a minimal, complete, verifiable example (definition here) of the code you have which clearly shows your difficulty?YTI wrote: Please suggest some calculations with which we can achieve it.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |