Erroneous data in the ChartGrid while edit the value...
Posted: Fri Mar 03, 2006 6:36 am
Hi,
I am using the Teechart latest version 7.0.0.6. I am using the ChartGrid also. I created series0 of type line and created one more series as series1. For series1 the datasource is series0 and setting the smoothing function. I am showing the chartgrid. I am seeing 120 rows in the grid. Because I am setting the FunctionType.asSmoothing.Factor = 10 for series2. But hiding the series2 columns in the grid. When I entering the 110 in the 12th row, in the 3rd row 11 is added in the x axis column and 0 in the Y axis column. This is cuasing the problem. I do not the know what could be the problem. My intension is display the data only for series0. Then I can modify the values in the grid. Which intern reflect the graph.
Now I am not able add a new row in the grid. How can we add a new row.
Please find the code below to reproduce the problem. You just copy this code to a form. Please let me know if you need more information. I need to solve this problem as early as possible. Because my dead line is next weekend.
Private Sub Form_Load()
Dim XCoords(1 To 11) As Double
Dim YCoords(1 To 11) As Double
Dim i As Integer
XCoords(1) = 2.33
YCoords(1) = 27.778
XCoords(2) = 6.46
YCoords(2) = 62.778
XCoords(3) = 9.71
YCoords(3) = 93.333
XCoords(4) = 19.86
YCoords(4) = 165.566
XCoords(5) = 25.74
YCoords(5) = 204.444
XCoords(6) = 38.21
YCoords(6) = 287.778
XCoords(7) = 46.89
YCoords(7) = 343.33
XCoords(8) = 51.17
YCoords(8) = 371.111
XCoords(9) = 67.7
YCoords(9) = 498.889
XCoords(10) = 74.91
YCoords(10) = 565.556
XCoords(11) = 100
YCoords(11) = 817.32
With TChart1
.Legend.LegendStyle = lsSeries
.Legend.CheckBoxes = True
.Legend.Visible = True
.Axis.Bottom.Labels.MultiLine = True
.Axis.Bottom.Automatic = False
.Axis.Bottom.SetMinMax 0#, 101#
.Axis.Bottom.Title.Caption = "X - Axis"
.Axis.Bottom.Title.Font.Bold = True
.Axis.Left.Title.Caption = "Y - Axis"
.Axis.Left.Title.Font.Bold = True
.Header.Text.Clear
.Header.Text.Add "Test"
.AddSeries scLine
End With
With TChart1.Series(0)
.asLine.Pointer.Visible = True
.asLine.Pointer.Style = psDownTriangle
.asLine.Pointer.VerticalSize = 2
For i = 1 To 11
.AddXY XCoords(i), YCoords(i), CStr(XCoords(i)), vbRed
Next i
.Title = "Test"
End With
TChart1.AddSeries scLine
With TChart1.Series(1)
.SetFunction tfSmoothing
.DataSource = TChart1.Series(0).Name
.Color = vbRed
.FunctionType.asSmoothing.Factor = 10
.Title = "Test"
End With
With TChart1.Series(0)
.ShowInLegend = False
.asLine.LinePen.Visible = False
End With
TChart1.Tools.Add tcMarksTip
TChart1.Tools.Items(0).asMarksTip.Delay = 10
TChart1.Tools.Items(0).asMarksTip.Style = smsValue
ChartGrid1.Chart = TChart1
ChartGrid1.Cols.Widths(0) = 0
ChartGrid1.Cols.Widths(1) = 0
ChartGrid1.Cols.Widths(4) = 0
ChartGrid1.Cols.Widths(5) = 0
End Sub
Thanks & Regards,
Rama
I am using the Teechart latest version 7.0.0.6. I am using the ChartGrid also. I created series0 of type line and created one more series as series1. For series1 the datasource is series0 and setting the smoothing function. I am showing the chartgrid. I am seeing 120 rows in the grid. Because I am setting the FunctionType.asSmoothing.Factor = 10 for series2. But hiding the series2 columns in the grid. When I entering the 110 in the 12th row, in the 3rd row 11 is added in the x axis column and 0 in the Y axis column. This is cuasing the problem. I do not the know what could be the problem. My intension is display the data only for series0. Then I can modify the values in the grid. Which intern reflect the graph.
Now I am not able add a new row in the grid. How can we add a new row.
Please find the code below to reproduce the problem. You just copy this code to a form. Please let me know if you need more information. I need to solve this problem as early as possible. Because my dead line is next weekend.
Private Sub Form_Load()
Dim XCoords(1 To 11) As Double
Dim YCoords(1 To 11) As Double
Dim i As Integer
XCoords(1) = 2.33
YCoords(1) = 27.778
XCoords(2) = 6.46
YCoords(2) = 62.778
XCoords(3) = 9.71
YCoords(3) = 93.333
XCoords(4) = 19.86
YCoords(4) = 165.566
XCoords(5) = 25.74
YCoords(5) = 204.444
XCoords(6) = 38.21
YCoords(6) = 287.778
XCoords(7) = 46.89
YCoords(7) = 343.33
XCoords(8) = 51.17
YCoords(8) = 371.111
XCoords(9) = 67.7
YCoords(9) = 498.889
XCoords(10) = 74.91
YCoords(10) = 565.556
XCoords(11) = 100
YCoords(11) = 817.32
With TChart1
.Legend.LegendStyle = lsSeries
.Legend.CheckBoxes = True
.Legend.Visible = True
.Axis.Bottom.Labels.MultiLine = True
.Axis.Bottom.Automatic = False
.Axis.Bottom.SetMinMax 0#, 101#
.Axis.Bottom.Title.Caption = "X - Axis"
.Axis.Bottom.Title.Font.Bold = True
.Axis.Left.Title.Caption = "Y - Axis"
.Axis.Left.Title.Font.Bold = True
.Header.Text.Clear
.Header.Text.Add "Test"
.AddSeries scLine
End With
With TChart1.Series(0)
.asLine.Pointer.Visible = True
.asLine.Pointer.Style = psDownTriangle
.asLine.Pointer.VerticalSize = 2
For i = 1 To 11
.AddXY XCoords(i), YCoords(i), CStr(XCoords(i)), vbRed
Next i
.Title = "Test"
End With
TChart1.AddSeries scLine
With TChart1.Series(1)
.SetFunction tfSmoothing
.DataSource = TChart1.Series(0).Name
.Color = vbRed
.FunctionType.asSmoothing.Factor = 10
.Title = "Test"
End With
With TChart1.Series(0)
.ShowInLegend = False
.asLine.LinePen.Visible = False
End With
TChart1.Tools.Add tcMarksTip
TChart1.Tools.Items(0).asMarksTip.Delay = 10
TChart1.Tools.Items(0).asMarksTip.Style = smsValue
ChartGrid1.Chart = TChart1
ChartGrid1.Cols.Widths(0) = 0
ChartGrid1.Cols.Widths(1) = 0
ChartGrid1.Cols.Widths(4) = 0
ChartGrid1.Cols.Widths(5) = 0
End Sub
Thanks & Regards,
Rama