space isssue
hey, thanks so much for sending the solution. I tried the code , the only issue is now taht i have vb.net and this is in c sharp. so i tried to convert it, but at this line
tChart1.GetAxisLabel += new Steema.TeeChart.GetAxisLabelEventHandler(tChart1_GetAxisLabel);
it gives error.. it sauys use raoise event.. but when i use taht it does not take.
Can u send me its equivalent vb.net code. thanks so much for ur help.
tChart1.GetAxisLabel += new Steema.TeeChart.GetAxisLabelEventHandler(tChart1_GetAxisLabel);
it gives error.. it sauys use raoise event.. but when i use taht it does not take.
Can u send me its equivalent vb.net code. thanks so much for ur help.
i tried to convert using a utility..
Private Sub InitializeChart()
chartController1.Chart = tChart1
tChart1.Series.Add(New Steema.TeeChart.Styles.Bar())
tChart1.Series(0).Add(123, "really long long label 1", Color.Red)
tChart1.Series(0).Add(456, "really long long label 2", Color.Blue)
tChart1.Series(0).Add(321, "really long long label 3", Color.Green)
tChart1.Axes.Bottom.Labels.Angle = 90
tChart1.GetAxisLabel += New Steema.TeeChart.GetAxisLabelEventHandler(tChart1_GetAxisLabel)
End Sub
Private Sub tChart1_GetAxisLabel(ByVal sender As Object, ByVal e As Steema.TeeChart.GetAxisLabelEventArgs)
If e.LabelText.Length > 16 Then
Dim tmp1 As String = e.LabelText.Substring(0,16)
Dim tmp2 As String = e.LabelText.Substring(16,e.LabelText.Length-16)
e.LabelText = String.Format("{0}{1}{2}", tmp1, "\n", tmp2)
End If
End Sub
'BUT it gives error - Use a raiseevent statement to raise an event at this line- " tChart1.GetAxisLabel += New Steema.TeeChart.GetAxisLabelEventHandler(tChart1_GetAxisLabel)"
Private Sub InitializeChart()
chartController1.Chart = tChart1
tChart1.Series.Add(New Steema.TeeChart.Styles.Bar())
tChart1.Series(0).Add(123, "really long long label 1", Color.Red)
tChart1.Series(0).Add(456, "really long long label 2", Color.Blue)
tChart1.Series(0).Add(321, "really long long label 3", Color.Green)
tChart1.Axes.Bottom.Labels.Angle = 90
tChart1.GetAxisLabel += New Steema.TeeChart.GetAxisLabelEventHandler(tChart1_GetAxisLabel)
End Sub
Private Sub tChart1_GetAxisLabel(ByVal sender As Object, ByVal e As Steema.TeeChart.GetAxisLabelEventArgs)
If e.LabelText.Length > 16 Then
Dim tmp1 As String = e.LabelText.Substring(0,16)
Dim tmp2 As String = e.LabelText.Substring(16,e.LabelText.Length-16)
e.LabelText = String.Format("{0}{1}{2}", tmp1, "\n", tmp2)
End If
End Sub
'BUT it gives error - Use a raiseevent statement to raise an event at this line- " tChart1.GetAxisLabel += New Steema.TeeChart.GetAxisLabelEventHandler(tChart1_GetAxisLabel)"
Hello shikha,
The example code of VB is next:
Form_Load:
InitializeChart:
GetAxisEvent:
I have assigned GetAxisLabels event at design time, because it's more easy. Please check that this code works fine.
I hope that will helps.
Thanks,
The example code of VB is next:
Form_Load:
Code: Select all
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
InitializeChart()
End Sub
Code: Select all
Private Sub InitializeChart()
ChartController1.Chart = TChart1
TChart1.Series.Add(New Steema.TeeChart.Styles.Bar())
TChart1.Series(0).Marks.Visible = False
TChart1.Series(0).Add(123, "really long long label 1", Color.Red)
TChart1.Series(0).Add(456, "really long long label 2", Color.Blue)
TChart1.Series(0).Add(321, "really long long label 3", Color.Green)
TChart1.Axes.Bottom.Labels.Angle = 90
End Sub
Code: Select all
Private Sub tChart1_GetAxisLabel(ByVal sender As Object, ByVal e As Steema.TeeChart.GetAxisLabelEventArgs) Handles TChart1.GetAxisLabel
If e.LabelText.Length > 16 Then
Dim tmp1 As String = e.LabelText.Substring(0, 16)
Dim tmp2 As String = e.LabelText.Substring(16, e.LabelText.Length - 16)
e.LabelText = String.Format("{0}{1}{2}", tmp1, vbCrLf, tmp2)
End If
End Sub
I have assigned GetAxisLabels event at design time, because it's more easy. Please check that this code works fine.
I hope that will helps.
Thanks,
Best Regards,
Sandra Pazos / 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 |
Hi shikha,
Try playing with the following properties until you'll find your desired combination:
Try playing with the following properties until you'll find your desired combination:
Code: Select all
TChart1.Panel.MarginBottom = 0
Chart1.Axes.Bottom.RelativePosition = -12
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi shikha,
In a beginning you should modify your chart aspect at chart creation. If your labels change at any event, maybe you should do some calculations and change your chart aspect there.
In a beginning you should modify your chart aspect at chart creation. If your labels change at any event, maybe you should do some calculations and change your chart aspect there.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: space isssue
Hi shikha,
For topic consistency and so that it is easier for everyone to follow each topic I splitted your last post into another thread as it's a problem different from what was originally discussed here. You can follow the new thread here:
http://www.teechart.net/support/viewtop ... =4&t=10020
We will appreciate that you start a new thread for each different technical inquiry not related to an existing topic.
Thanks in advance.
For topic consistency and so that it is easier for everyone to follow each topic I splitted your last post into another thread as it's a problem different from what was originally discussed here. You can follow the new thread here:
http://www.teechart.net/support/viewtop ... =4&t=10020
We will appreciate that you start a new thread for each different technical inquiry not related to an existing topic.
Thanks in advance.
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: space isssue
Hi shikha,
Sorry, I wrongly splitted the first topic instead of the last, new topic is this one:
http://www.teechart.net/support/viewtop ... =4&t=10021
Sorry, I wrongly splitted the first topic instead of the last, new topic is this one:
http://www.teechart.net/support/viewtop ... =4&t=10021
Best Regards,
Narcís Calvet / 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 |