Page 1 of 1

Problems with: Series colour, BoxPlot and DragPoint Tool

Posted: Thu Apr 17, 2008 11:50 am
by 13047123
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

Posted: Thu Apr 17, 2008 1:19 pm
by narcis
Hi Oswald,

Please find below the answers to your questions:

Problem 1: This happen when setting pointer's width and height and it's certainly a bug (TF02012979) that I've added to our defect list to be fixed for next releases.

Problem 2: Could you please send us a simple example project we can run "as-is" to reproduce the problem here or at least post FunctionToFillArrayList code?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
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!!
I could reproduce this issue as well even I checked it also happens with latest v2 release. Anyway, I've added this (TF02012980) to our defect list to be fixed for future releases.

Posted: Fri Apr 18, 2008 8:12 am
by narcis
Hi Oswald,

Thanks for the example project. I could reproduce the issue here in v3 but couldn't reproduce it using latest v2 release. Could you please let us know the TeeChart for .NET v2 build number with which you could get that working?

In the meantime I've added the issue (TF02012982) to the bug list to be reviewed but it would be very helpful knowing when it was broken so that we may be able to include the same code again.

Thanks in advance.

Posted: Wed May 21, 2008 11:31 am
by narcis
Hi Oswald,

We have been reviewing TF02012979 and using TeeChart for .NET v3 you should do use code below as in v3 some of the important color settings only happen once the series has been added to the SeriesCollection. That's why that has to happen first.

Code: Select all

  private void InitializeChart()
  {
    Steema.TeeChart.Styles.Points aNewPtSeries;
    int ItemCount;
    Random y = new Random();
    ItemCount = 5;
    for (int i = 0; (i <= (ItemCount - 1)); i++)
    {
      aNewPtSeries = new Steema.TeeChart.Styles.Points(tChart1.Chart); // <- modify this line
      aNewPtSeries.LinePen.Width = 1;
      aNewPtSeries.Pointer.HorizSize = 2;
      aNewPtSeries.Pointer.VertSize = aNewPtSeries.Pointer.HorizSize;
      //tChart1.Series.Add(aNewPtSeries); <- remove this line
      // Now add values to the series
      for (int cNdx = 0; (cNdx <= (ItemCount * 2)); cNdx++)
      {
        aNewPtSeries.Add((cNdx + 1), y.Next());
      }
    }
  }

Posted: Wed May 21, 2008 11:33 am
by narcis
Hi Oswald,

About TF02012981, it's very similar to TF02012979 and in that case you should do this:

Code: Select all

ColorBand colorband = new ColorBand(tChart1.Chart;); // <- changed line
colorband.Axis = tChart1.Axes.Left;
colorband.Brush.Color = System.Drawing.Color.Red;
colorband.Brush.Solid = true;
colorband.DrawBehind = true;
colorband.End = 300;
colorband.ResizeEnd = false;
colorband.ResizeStart = false;
colorband.Start = 250;
colorband.Pen.Visible = false; // hides the edge lines
colorband.Transparency = 50;
tChart1.Tools.Add(colorband);

Posted: Mon Aug 18, 2008 5:10 am
by 13047123
narcis wrote:Hi Oswald,

About TF02012981, it's very similar to TF02012979 and in that case you should do this:

Code: Select all

ColorBand colorband = new ColorBand(tChart1.Chart;); // <- changed line
colorband.Axis = tChart1.Axes.Left;
colorband.Brush.Color = System.Drawing.Color.Red;
colorband.Brush.Solid = true;
colorband.DrawBehind = true;
colorband.End = 300;
colorband.ResizeEnd = false;
colorband.ResizeStart = false;
colorband.Start = 250;
colorband.Pen.Visible = false; // hides the edge lines
colorband.Transparency = 50;
tChart1.Tools.Add(colorband);

Hi Narcis,
thanks for your replies and sorry for not getting back to you earlier.
Actually, the solution to TF02012979 worked perfectly. Thanks very much.
My understanding is that the posts were:
TF02012979 (point series problem), TF02012980 (DragPoint tool problem), and TF02012982 (BoxPlot problem). Your solution posted on May 21 refers to TF02012981 and includes code regarding a Colorband Tool). I am not sure that this is the correct solution to the BoxPlot problem. Can you check that again please? And the DragPoint Tool problem is being taken care of in future releases. So there will be no workaround for the current TChart version? (I am using Version 3.2.2945.19737)
Thanks in advance and sorry for getting back to you so late,
Oswald

Posted: Mon Aug 25, 2008 9:32 am
by narcis
Hi Oswald,

I've checked that TF02012980 and TF02012982 were fixed on latest TeeChart for .NET v3 maintenance releases. Could you please download latest build available at the client area and let us know if they work fine at your end?

Thanks in advance.

Posted: Tue Sep 02, 2008 5:02 am
by 13047123
narcis wrote:Hi Oswald,

I've checked that TF02012980 and TF02012982 were fixed on latest TeeChart for .NET v3 maintenance releases. Could you please download latest build available at the client area and let us know if they work fine at your end?

Thanks in advance.
Hi Narcis,
thank you very much for you reply. I have downloaded the .Net v3 release. The DragPoint Tool problem is resolved. Unfortunately, the box-plot does not seem to work. I have debugged the code and the arraylist that I pass to the BoxPlotSeries contains the correct values. My code looks like this

Dim aNewBPSeries As Steema.TeeChart.Styles.Box
For Each item in myList
aNewBPSeries = New Steema.TeeChart.Styles.Box(aChart.Chart)
aNewBPSeries.Clear()
aNewBPSeries.Color = Color.LightGray
aNewBPSeries.LinePen.Width = 1
aNewBPSeries.Box.HorizSize = 5
aNewBPSeries.Position = cNdx + 1
Dim ValList As New ArrayList
ValList = RoutineToReturnValuesForTheArrayList
ValList.Sort()
aChart.Series.Add(aNewBPSeries)
cNdx += 1
Next

If I try to access the BoxPlotSeries via the aNewBpSeries.YValues.Item property, I do not encounter any values.
Regards,
Oswald

Posted: Mon Sep 08, 2008 12:40 pm
by narcis
Hi Oswald,

Thanks for the information. For some reason I don't know at the moment TF02012982 was closed. However, it is still reproduceable so I openned it again to be fixed.