Problems with: Series colour, BoxPlot and DragPoint Tool
Posted: Thu Apr 17, 2008 11:50 am
The following code works perfectly well in TChart v2 whereas I am facing problems in using the same code in Tchart V3. I am pretty familiar with TChart and the task is not demanding which is why I started to wonder whether the problems mentioned below may already have been reported as a bug. However, nobody is perfect, I may have ignored some things that may have changed
I am encountering a problem with the coloring of several series of point series if added during runtime (normally TChart automatically assignes a default color if not explicitly defined by the user, but in the case below no color is assigned). A second issue refers to a boxPlot Series that is not displayed even though values are correctly transferred to the series.
Dim aNewPtSeries As Steema.TeeChart.Styles.Points
Dim aNewBPSeries As Steema.TeeChart.Styles.Box
Dim i As Integer
Select Case chartStyle
Case 1 'point
'Problem 1: no color is assigned to the point series whilst adding each series. RGB of all points of every series is "255, 255, 255"
'the colouring of other series like LineChart etc. is fine and if point series are added via the TChart editor distinct colors for each series are correctly assigned as well.
For i = 0 To ItemCount - 1
aNewPtSeries = New Steema.TeeChart.Styles.Points
aNewPtSeries.LinePen.Width = 1
aNewPtSeries.Pointer.HorizSize = 2
aNewPtSeries.Pointer.VertSize = aNewPtSeries.Pointer.HorizSize
aChart.Series.Add(aNewPtSeries) 'Now add values to the series
Dim cNdx As Integer
For cNdx = 0 To ItemItemCount - 1
aChart.Series(i).Add(cNdx + 1, SomeDoubleValue )
Next cNdx
Next i
Case 2 'BoxPlot
'Problem 2: No BoxPlot series is plotted. Values are in ArrayList, series count is ok, but as said no boxPlots are not shown in the chart (code worked well in TChart version 2)
Dim cNdx As Integer
For cNdx = 0 To ItemCount- 1
aNewBPSeries = New Steema.TeeChart.Styles.Box
aNewBPSeries.Color = Color.LightGray
aNewBPSeries.LinePen.Width = 1
aNewBPSeries.Box.HorizSize = 5
aNewBPSeries.Position = cNdx + 1
Dim ValList As New ArrayList
ValList = FunctionToFillArrayList
ValList.Sort()
aNewBPSeries.Add(ValList)
aChart.Series.Add(aNewBPSeries)
Next cNdx
End Select
A last issue concerns the drag point tool. If a drag point tool is added and the mouse hovers over a series point (of the series to be dragged) the cursor turns into a hand (which is fine) but moving away from the point does not change the cursor back to the default cursor (see also TChart feature demo). This was also working in version 2. Is there a known bug? Any hint is appreciated!!
Regards,
Oswald
I am encountering a problem with the coloring of several series of point series if added during runtime (normally TChart automatically assignes a default color if not explicitly defined by the user, but in the case below no color is assigned). A second issue refers to a boxPlot Series that is not displayed even though values are correctly transferred to the series.
Dim aNewPtSeries As Steema.TeeChart.Styles.Points
Dim aNewBPSeries As Steema.TeeChart.Styles.Box
Dim i As Integer
Select Case chartStyle
Case 1 'point
'Problem 1: no color is assigned to the point series whilst adding each series. RGB of all points of every series is "255, 255, 255"
'the colouring of other series like LineChart etc. is fine and if point series are added via the TChart editor distinct colors for each series are correctly assigned as well.
For i = 0 To ItemCount - 1
aNewPtSeries = New Steema.TeeChart.Styles.Points
aNewPtSeries.LinePen.Width = 1
aNewPtSeries.Pointer.HorizSize = 2
aNewPtSeries.Pointer.VertSize = aNewPtSeries.Pointer.HorizSize
aChart.Series.Add(aNewPtSeries) 'Now add values to the series
Dim cNdx As Integer
For cNdx = 0 To ItemItemCount - 1
aChart.Series(i).Add(cNdx + 1, SomeDoubleValue )
Next cNdx
Next i
Case 2 'BoxPlot
'Problem 2: No BoxPlot series is plotted. Values are in ArrayList, series count is ok, but as said no boxPlots are not shown in the chart (code worked well in TChart version 2)
Dim cNdx As Integer
For cNdx = 0 To ItemCount- 1
aNewBPSeries = New Steema.TeeChart.Styles.Box
aNewBPSeries.Color = Color.LightGray
aNewBPSeries.LinePen.Width = 1
aNewBPSeries.Box.HorizSize = 5
aNewBPSeries.Position = cNdx + 1
Dim ValList As New ArrayList
ValList = FunctionToFillArrayList
ValList.Sort()
aNewBPSeries.Add(ValList)
aChart.Series.Add(aNewBPSeries)
Next cNdx
End Select
A last issue concerns the drag point tool. If a drag point tool is added and the mouse hovers over a series point (of the series to be dragged) the cursor turns into a hand (which is fine) but moving away from the point does not change the cursor back to the default cursor (see also TChart feature demo). This was also working in version 2. Is there a known bug? Any hint is appreciated!!
Regards,
Oswald