Page 1 of 1
Problem with "data table" tool over writing axis labels
Posted: Wed May 25, 2011 5:27 am
by 15654268
Hi There,
I'm using dot net version 4.1.2011.4190 in a vs2003 vb development environment and am having problems with the data table tool over writing the bottom axis labels. It appears that the issue occurs when the axis labels are more than a couple of characters long.
If you use your Feature demo and go to Welcome !\Tools\Data Table.
Double click the yellow portion of the window to get the TeeChart Editor up, go to the data tab and change the X values from 0,1,2,3,4,5 to 1111111111,2222222222,3333333333,4444444444,5555555555,6666666666 you will see what I mean.
- N1.png (26.9 KiB) Viewed 32296 times
I can't find any way to correct this, can you look into it please.
Re: Problem with "data table" tool over writing axis labels
Posted: Wed May 25, 2011 5:31 am
by 15654268
Also, The DataTableEditor dialog has many errors
on the Format tab, "Automati" and "Auto Offse"
Auto Offset once checked doesn't seem to do anything when unchecked.
on Legend tab, "Visibl", "Series font colo", "Other sid"
Legend Symbol tab has nothing on it.
Can these be correted please.
Re: Problem with "data table" tool over writing axis labels
Posted: Wed May 25, 2011 10:16 am
by 10050769
Hello Adrian,
I'm using dot net version 4.1.2011.4190 in a vs2003 vb development environment and am having problems with the data table tool over writing the bottom axis labels. It appears that the issue occurs when the axis labels are more than a couple of characters long.
I suggest that try to use custom position of DataTable tool changing property AutoPosition = true to false and assign position left and top as you want.
About DataTableEditor, for me seems work as I expected in:
on the Format tab, "Automati" and "Auto Offse" and
Auto Offset once checked doesn't seem to do anything when unchecked.
- DataTableEdior1.jpg (26.42 KiB) Viewed 32231 times
on Legend tab, "Visibl", "Series font colo", "Other sid"
- DataTableEdior2.jpg (22.81 KiB) Viewed 32234 times
On the other hand, I can see that you are right with tab of Legend Symbol and I have added it in wish-list as a bug report with number [TF02015588]. We will try to fix it to next versions of TeeChart.Net.
Thanks,
Re: Problem with "data table" tool over writing axis labels
Posted: Wed May 25, 2011 10:52 pm
by 15654268
Thanks for the quick reply Sandra,
I see from your screen shots that your installations seems to behave a little different to mine, here is a simmilar screen shot showing the missing characters, any ideas on why it's different.
- n1.png (12.05 KiB) Viewed 32218 times
Also, can you explain what the Automatic offset is for. I have made changes to use custom position but the problem is that I also have to manually change the bottom label size otherwise the labels overwrite the data table. As my labels are dynamic, changing from chart refresh to chart refresh I have to set he label size big enough for the largest possible label which when they are all short makes lots of wasted space. I also have to set the size of the left axis labels quite large otherwise the start of the data table legend is cut off. This image shows the chart with the left axis labels set to the default of 0.
- n3.png (24.84 KiB) Viewed 32217 times
This image shows how I think the chart should look with Automatic Offset checked.
- n2.png (27.02 KiB) Viewed 32216 times
Can you have a look at these issues please.
Re: Problem with "data table" tool over writing axis labels
Posted: Fri May 27, 2011 10:39 am
by 10050769
Hello Captell,
I see from your screen shots that your installations seems to behave a little different to mine, here is a similar screen shot showing the missing characters, any ideas on why it's different.
Sorry for the delay. Please, can check if you are using last version of TeeChart.Net so I have use last version of TeeChart.Net and editor works fine:
- ChartEditor1.jpg (45.09 KiB) Viewed 32195 times
Could you please, try to arrange a simple project so we can reproduce exactly here?
Also, can you explain what the Automatic offset is for. I have made changes to use custom position but the problem is that I also have to manually change the bottom label size otherwise the labels overwrite the data table. As my labels are dynamic, changing from chart refresh to chart refresh I have to set he label size big enough for the largest possible label which when they are all short makes lots of wasted space. I also have to set the size of the left axis labels quite large otherwise the start of the data table legend is cut off. This image shows the chart with the left axis labels set to the default of 0.
I have made a simple project that use MaxLabelsWidth in After Draw event, to modify the margins of panel and I think can help you:
Code: Select all
Public Sub New()
' This call is required by the designer.
InitializeComponent()
InitializeChart()
' Add any initialization after the InitializeComponent() call.
End Sub
Private datatable1 As Steema.TeeChart.Tools.DataTableTool
Private Sub InitializeChart()
Dim bar1 As New Steema.TeeChart.Styles.Bar(tChart1.Chart)
Dim bar2 As New Steema.TeeChart.Styles.Bar(tChart1.Chart)
datatable1 = New Steema.TeeChart.Tools.DataTableTool(tChart1.Chart)
bar1.FillSampleValues(5)
bar2.FillSampleValues(5)
tChart1.Axes.Bottom.Labels.Items.Clear()
For i As Integer = 0 To bar1.Count - 1
tChart1.Axes.Bottom.Labels.Items.Add(bar1.XValues(i), "Label:" & bar1.XValues(i).ToString() & "0000")
Next
tChart1.Axes.Bottom.Labels.Angle = 90
datatable1.ColumnPen.Visible = True
datatable1.RowPen.Visible = True
datatable1.ColumnPen.Color = Color.Black
datatable1.RowPen.Color = Color.Black
datatable1.AutoPosition = False
AddHandler TChart1.AfterDraw, AddressOf tChart1_AfterDraw
'tChart1.AfterDraw += New Steema.TeeChart.PaintChartEventHandler(AddressOf tChart1_AfterDraw)
tChart1.Draw()
End Sub
Private Sub tChart1_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D)
tChart1.Panel.MarginLeft = Math.Abs(tChart1.Axes.Bottom.MaxLabelsWidth() - tChart1.Axes.Left.Position)
datatable1.Left = 0
tChart1.Panel.MarginBottom = (tChart1.Axes.Bottom.MaxLabelsWidth() / 2) - tChart1.Panel.MarginBottom
datatable1.Top = tChart1.Axes.Bottom.Position
End Sub
Can you tell us if previous code works as you expected?
Thanks,
Re: Problem with "data table" tool over writing axis labels
Posted: Fri May 27, 2011 10:41 pm
by 15654268
The version I'm using is 4.1.2011.4190 in a VS 2003 development environment using VB.Net.
I'l work on a sample today.
Re: Problem with "data table" tool over writing axis labels
Posted: Fri May 27, 2011 11:17 pm
by 15654268
This work around doesn't work.
Firstly, the onAfterDraw event fires multiple times which results in the chart and datatable being shifted off the visible area, the marginleft and marginbottom values are incremented each time it fires.
Secondly, it fixes the datatable in a specific position, so if the tchart has a dock value of fill and you resize the window the datatable remains fixed so the chart ends up sliding under it again.
To recreate these problems add a new winform to a project, add a tchart component with dock = fill and then copy in the above code.
I'm assuming the datatable.AutoPosition is supposed to do all this for me, can you provide some feedback on what this property is supposed to do. and if it's broken some idea on when it will be fixed?
Thanks.
Re: Problem with "data table" tool over writing axis labels
Posted: Sat May 28, 2011 12:44 am
by 15654268
The proposed workaround will also not work if the chart is a horizontal bar.
Re: Problem with "data table" tool over writing axis labels
Posted: Mon May 30, 2011 11:26 am
by 10050769
Hello Captell,
Ok. I have modified code and seems works fine for me:
Code: Select all
Public Sub New()
' This call is required by the designer.
InitializeComponent()
InitializeChart()
' Add any initialization after the InitializeComponent() call.
End Sub
Private datatable1 As Steema.TeeChart.Tools.DataTableTool
Private OLeftPosition, OMarginBottom, OBottomPosition As Integer
Private Sub InitializeChart()
TChart1.Dock = DockStyle.Fill
Dim bar1 As New Steema.TeeChart.Styles.Bar(TChart1.Chart)
Dim bar2 As New Steema.TeeChart.Styles.Bar(TChart1.Chart)
datatable1 = New Steema.TeeChart.Tools.DataTableTool(TChart1.Chart)
bar1.FillSampleValues(5)
bar2.FillSampleValues(5)
TChart1.Axes.Bottom.Labels.Items.Clear()
For i As Integer = 0 To bar1.Count - 1
TChart1.Axes.Bottom.Labels.Items.Add(bar1.XValues(i), "Label:" & bar1.XValues(i).ToString() & "0000")
Next
TChart1.Axes.Bottom.Labels.Angle = 90
datatable1.ColumnPen.Visible = True
datatable1.RowPen.Visible = True
datatable1.ColumnPen.Color = Color.Black
datatable1.RowPen.Color = Color.Black
datatable1.AutoPosition = False
TChart1.Draw()
OLeftPosition = TChart1.Axes.Left.Position
OMarginBottom = TChart1.Panel.MarginBottom
OBottomPosition = TChart1.Axes.Bottom.Position
AddHandler TChart1.AfterDraw, AddressOf tChart1_AfterDraw
TChart1.Draw()
TChart1.Draw()
End Sub
Private Sub tChart1_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D)
TChart1.Panel.MarginLeft = Math.Abs(TChart1.Axes.Bottom.MaxLabelsWidth() - OLeftPosition)
datatable1.Left = 0
TChart1.Panel.MarginBottom = (TChart1.Axes.Bottom.MaxLabelsWidth() / 2) - OMarginBottom
datatable1.Top = TChart1.Axes.Bottom.Position + TChart1.Axes.Bottom.MaxLabelsWidth()
End Sub
End Class
Could you tell us if previous code works as you expect?
On the other hand, If you want do same that above code, but using HorizBar, you can do something as next code:
Code: Select all
Private datatable1 As Steema.TeeChart.Tools.DataTableTool
Private OLeftPosition, OMarginBottom, OBottomPosition, OLeftMargin As Integer
Private Sub InitializeChart()
TChart1.Dock = DockStyle.Fill
Dim bar1 As New Steema.TeeChart.Styles.HorizBar(TChart1.Chart)
Dim bar2 As New Steema.TeeChart.Styles.HorizBar(TChart1.Chart)
datatable1 = New Steema.TeeChart.Tools.DataTableTool(TChart1.Chart)
bar1.FillSampleValues(5)
bar2.FillSampleValues(5)
TChart1.Axes.Left.Labels.Items.Clear()
For i As Integer = 0 To bar1.Count - 1
TChart1.Axes.Left.Labels.Items.Add(bar1.YValues(i), "Label:" & bar1.YValues(i).ToString() + "000")
Next
datatable1.ColumnPen.Visible = True
datatable1.RowPen.Visible = True
datatable1.ColumnPen.Color = Color.Black
datatable1.RowPen.Color = Color.Black
datatable1.AutoPosition = False
TChart1.Draw()
OLeftMargin = TChart1.Panel.MarginLeft
OLeftPosition = TChart1.Axes.Left.Position
OMarginBottom = TChart1.Panel.MarginBottom
OBottomPosition = TChart1.Axes.Bottom.Position
AddHandler TChart1.AfterDraw, AddressOf tChart1_AfterDraw
TChart1.Draw()
TChart1.Draw()
End Sub
Private Sub tChart1_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D)
TChart1.Panel.MarginLeft = TChart1.Axes.Left.MaxLabelsWidth() / 2 - OLeftMargin
datatable1.Left = TChart1.Axes.Left.Position - TChart1.Axes.Left.MaxLabelsWidth()
datatable1.Top = 0
TChart1.Panel.MarginTop = TChart1.Axes.Left.StartPosition + TChart1.Axes.Left.MaxLabelsWidth() / 4
End Sub
Please, check if previous code works to you.
I hope will helps.
Thanks,
Re: Problem with "data table" tool over writing axis labels
Posted: Mon May 30, 2011 9:13 pm
by 15654268
I have tried your example above and it still doesnt work.
Code: Select all
Public Class datatable
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents TChart1 As Steema.TeeChart.TChart
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.TChart1 = New Steema.TeeChart.TChart
Me.SuspendLayout()
'
'TChart1
'
Me.TChart1.Dock = System.Windows.Forms.DockStyle.Fill
'
'TChart1.Footer
'
'
'TChart1.Footer.Bevel
'
Me.TChart1.Footer.Bevel.StringColorOne = "FFFFFFFF"
Me.TChart1.Footer.Bevel.StringColorTwo = "FF808080"
'
'TChart1.Header
'
'
'TChart1.Header.Bevel
'
Me.TChart1.Header.Bevel.StringColorOne = "FFFFFFFF"
Me.TChart1.Header.Bevel.StringColorTwo = "FF808080"
'
'TChart1.Legend
'
'
'TChart1.Legend.Bevel
'
Me.TChart1.Legend.Bevel.StringColorOne = "FFFFFFFF"
Me.TChart1.Legend.Bevel.StringColorTwo = "FF808080"
Me.TChart1.Location = New System.Drawing.Point(0, 0)
Me.TChart1.Name = "TChart1"
Me.TChart1.Size = New System.Drawing.Size(744, 470)
'
'TChart1.SubFooter
'
'
'TChart1.SubFooter.Bevel
'
Me.TChart1.SubFooter.Bevel.StringColorOne = "FFFFFFFF"
Me.TChart1.SubFooter.Bevel.StringColorTwo = "FF808080"
'
'TChart1.SubHeader
'
'
'TChart1.SubHeader.Bevel
'
Me.TChart1.SubHeader.Bevel.StringColorOne = "FFFFFFFF"
Me.TChart1.SubHeader.Bevel.StringColorTwo = "FF808080"
Me.TChart1.TabIndex = 0
'
'TChart1.Walls
'
'
'TChart1.Walls.Back
'
'
'TChart1.Walls.Back.Bevel
'
Me.TChart1.Walls.Back.Bevel.StringColorOne = "FFFFFFFF"
Me.TChart1.Walls.Back.Bevel.StringColorTwo = "FF808080"
'
'TChart1.Walls.Bottom
'
'
'TChart1.Walls.Bottom.Bevel
'
Me.TChart1.Walls.Bottom.Bevel.StringColorOne = "FFFFFFFF"
Me.TChart1.Walls.Bottom.Bevel.StringColorTwo = "FF808080"
'
'TChart1.Walls.Left
'
'
'TChart1.Walls.Left.Bevel
'
Me.TChart1.Walls.Left.Bevel.StringColorOne = "FFFFFFFF"
Me.TChart1.Walls.Left.Bevel.StringColorTwo = "FF808080"
'
'TChart1.Walls.Right
'
'
'TChart1.Walls.Right.Bevel
'
Me.TChart1.Walls.Right.Bevel.StringColorOne = "FFFFFFFF"
Me.TChart1.Walls.Right.Bevel.StringColorTwo = "FF808080"
'
'datatable
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(744, 470)
Me.Controls.Add(Me.TChart1)
Me.Name = "datatable"
Me.Text = "datatable"
Me.ResumeLayout(False)
End Sub
#End Region
Private OLeftPosition, OMarginBottom, OBottomPosition As Integer
Public Sub New()
' This call is required by the designer.
InitializeComponent()
InitializeChart()
' Add any initialization after the InitializeComponent() call.
End Sub
Private datatable1 As Steema.TeeChart.Tools.DataTableTool
Private Sub InitializeChart()
TChart1.Dock = DockStyle.Fill
Dim bar1 As New Steema.TeeChart.Styles.Bar(TChart1.Chart)
Dim bar2 As New Steema.TeeChart.Styles.Bar(TChart1.Chart)
datatable1 = New Steema.TeeChart.Tools.DataTableTool(TChart1.Chart)
bar1.FillSampleValues(5)
bar2.FillSampleValues(5)
TChart1.Axes.Bottom.Labels.Items.Clear()
For i As Integer = 0 To bar1.Count - 1
TChart1.Axes.Bottom.Labels.Items.Add(bar1.XValues(i), "Label:" & bar1.XValues(i).ToString() & "0000")
Next
TChart1.Axes.Bottom.Labels.Angle = 90
datatable1.ColumnPen.Visible = True
datatable1.RowPen.Visible = True
datatable1.ColumnPen.Color = Color.Black
datatable1.RowPen.Color = Color.Black
datatable1.AutoPosition = False
TChart1.Draw()
OLeftPosition = TChart1.Axes.Left.Position
OMarginBottom = TChart1.Panel.MarginBottom
OBottomPosition = TChart1.Axes.Bottom.Position
AddHandler TChart1.AfterDraw, AddressOf tChart1_AfterDraw
TChart1.Draw()
TChart1.Draw()
End Sub
Private Sub tChart1_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D) Handles TChart1.AfterDraw
TChart1.Panel.MarginLeft = Math.Abs(TChart1.Axes.Bottom.MaxLabelsWidth() - OLeftPosition)
datatable1.Left = 0
TChart1.Panel.MarginBottom = (TChart1.Axes.Bottom.MaxLabelsWidth() / 2) - OMarginBottom
datatable1.Top = TChart1.Axes.Bottom.Position + TChart1.Axes.Bottom.MaxLabelsWidth()
End Sub
End Class
- 31-05-2011 07-02-42.png (26.2 KiB) Viewed 32142 times
If I resize the window with the mouse I can see the datatable at the bottom but only briefly.
Also, this solution doesn't work if there are footnotes, the data table sits over the footnotes. I also won't work if the lavels are not at 90 degrees.
I've asked a couple of times before about datatable.AutoPosition, is not this property supposed to do this automatically for me. Also the Auto Offset property messes up the chart when clicked, unclicking it does not restore .
Can I please get an answer to this issue? My application allows the user to build and configure their own charts using the chart property editor. A coded workaround solution will not work as I don't know what the user will want before hand. To avoid the other issues with chart property editor such as offset and symbol page as described above I've turned off the Tools tab and have provided a separate menu to add data tables but I doubt I'll be able to provide a satisfactory code around to the positioning issue.
Re: Problem with "data table" tool over writing axis labels
Posted: Tue May 31, 2011 3:03 pm
by 10050769
Hello Captell,
Ok, I can reproduce as you said but only when I assign, AfterDraw event to design time.
Can you please check, if you can reproduce this problem in attach project? And also, If problem doesn't appears using my attach project, can you confirm us, if code works as you want?
Thanks,
Re: Problem with "data table" tool over writing axis labels
Posted: Wed Jun 01, 2011 7:56 am
by 15654268
Hi Sandra,
I tried your enclosed application but it wont load properly in VS 2003. As mentioned at the start of this thread I'm using vs2003. Do you have a version that loads in VS 2003.
Thanks.
Re: Problem with "data table" tool over writing axis labels
Posted: Wed Jun 01, 2011 12:12 pm
by 10050769
Hello Captell,
I've asked a couple of times before about datatable.AutoPosition, is not this property supposed to do this automatically for me. Also the Auto Offset property messes up the chart when clicked, unclicking it does not restore .
Sorry I have forgotten answer this question. Property AutoPosition Gets or sets whether datatableTool positioning is automatically calculated when is setting to true, but when is set to false you have calculate the position of datatableTool manually.
On the other hand, sorry for my error, I have made other example using VS2003 that works fine for me.
Also we have found the problems there were when you would draw datatable in a correct position. Now this works as we expected. Please, check if my attached project works as you want.
I hope will helps.
Thanks,
Re: Problem with "data table" tool over writing axis labels
Posted: Thu Jun 16, 2011 11:44 am
by 10050769
Hello Adrian,
I inform that the bug with number (TF02015588) is fixed to next maintenance release of TeeChart.Net. I recommend you to be aware at this forum or subscribe to our
RSS news feed for new release announcements and what's implemented on them.
Thanks,