Page 1 of 2

Shape problems after upgrading from V2 to V3

Posted: Fri Apr 18, 2008 7:52 pm
by 14045166
Hopefully someone can help with this and I appologize if it has been covered before, but I couldn't find anything that matched my problem.
So, I had a working gantt with custom shapes in V2.x, but after upgrading to the latest version(april 4th release), the shapes lost their positions and now appear as a line vertically down the chart. I am displaying shapes this way:

Code: Select all

Steema.TeeChart.Styles.Shape shpPyramid = new Steema.TeeChart.Styles.Shape();
shpPyramid.Style = Steema.TeeChart.Styles.ShapeStyles.Pyramid;
shpPyramid.HorizAxis = Steema.TeeChart.Styles.HorizontalAxis.Top;
shpPyramid.Add(dtSD, counter - dblScale, Color.Blue);
shpPyramid.Add(dtSDP1, counter + dblScale, Color.Blue);
shpPyramid.Color = Color.Blue;
shpPyramid.ShowInLegend = false;
wcFielding.Chart.Series.Add(shpPyramid);
The shapes should start at the date that I pass to them(dtSD) and extend 50 days past that date for the end point(dtSDP1).
Like I said, this code was all working in V2.x...Is there something I'm doing wrong in V3?

Thanks for your help.

Posted: Mon Apr 21, 2008 8:08 am
by narcis
Hi SDO,

No that I know of. An issue with shape series (TF02012873) was fixed in the 4th April maintenance release but it doesn't seem to be the same as yours. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

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

Thanks in advance.

Posted: Mon Apr 21, 2008 5:01 pm
by 14645398
Hi,

Thanks for your response. I have uploaded the file via your upload page.

It won't run as it stands as it is database driven, but maybe you can see something in the code that isn't right.

Thank you for your help!

Posted: Tue Apr 22, 2008 9:52 am
by narcis
Hi SDO,

Thanks for the code.

You could try populating shape series like this:

Code: Select all

shpPyramid.Color=Color.Blue;
shpPyramid.X0=dtSD;
shpPyramid.Y0=counter - dblScale;
shpPyramid.X1=dtSDP1;
shpPyramid.Y1=counter + dblScale;
If this doesn't help, could you please try reproducing the issue in a simple example as the one Christopher Ireland posted here?

Thanks in advance.

Posted: Tue Apr 22, 2008 8:56 pm
by 14645398
Hi,

Unfortunately, your previous example doesn't accept dates as inputs. I did try and converting the dates to doubles, but that didn't work either. I did notice a pattern while troubleshooting that I think might help this problem.

With my first example:

Code: Select all

Steema.TeeChart.Styles.Shape shpPyramid = new Steema.TeeChart.Styles.Shape(); 
shpPyramid.Style = Steema.TeeChart.Styles.ShapeStyles.Pyramid; 
shpPyramid.HorizAxis = Steema.TeeChart.Styles.HorizontalAxis.Top; 
shpPyramid.Add(dtSD, counter - dblScale, Color.Blue); 
shpPyramid.Add(dtSDP1, counter + dblScale, Color.Blue); 
shpPyramid.Color = Color.Blue; 
shpPyramid.ShowInLegend = false; 
//old way on this line
wcFielding.Chart.Series.Add(shpPyramid);
... The shapes weren't displaying at all on the gantt chart. If I changed where I added the shape to the chart like this:

Code: Select all

//new way on this line
Steema.TeeChart.Styles.Shape shpPyramid = new Steema.TeeChart.Styles.Shape(wcFielding.Chart); 
shpPyramid.Style = Steema.TeeChart.Styles.ShapeStyles.Pyramid; 
shpPyramid.HorizAxis = Steema.TeeChart.Styles.HorizontalAxis.Top; 
shpPyramid.Add(dtSD, counter - dblScale, Color.Blue); 
shpPyramid.Add(dtSDP1, counter + dblScale, Color.Blue); 
shpPyramid.Color = Color.Blue; 
shpPyramid.ShowInLegend = false; 
... The shape is added, but as a big vertical line down the left of the chart with a date of 12/1899, as 1899 is the earliest it can go. How can I do it this way and have it accept the date values that I provide it?

Thanks.

Posted: Wed Apr 23, 2008 9:06 am
by narcis
Hi SDO,

You could try using ToOADate for converting DateTime values to double.

Code: Select all

shpPyramid.X0=dtSD.ToOADate();

Posted: Wed Apr 23, 2008 2:22 pm
by 14645398
Hi,

I tried that with the same results.

Any other suggestions?

Posted: Wed Apr 23, 2008 2:59 pm
by narcis
Hi SDO,

Sorry but I don't have any other idea at the moment, it would be very helpful if you could send us a simple example project we can run "as-is" to reproduce the problem here. You could populate your series as in Christopher Ireland's project I pointed you.

Thanks in advance.

Posted: Wed Apr 23, 2008 3:02 pm
by 14645398
I'm doing so as I'm writing this. I will repost once I have it uploaded to you.

Posted: Wed Apr 23, 2008 9:02 pm
by 14645398
I have uploaded a web project via your upload page. It is a static representation of what I am trying to display. It is having all of the same issues as my other project, so it is a good base to work off of.

What should be happening is that all the shapes should be appearing on top of their respective gantt series.

Thanks and I will look forward to seeing what you find.

Posted: Thu Apr 24, 2008 9:39 am
by narcis
Hi SDO,

Thanks for the example project. I could reproduce the issue here in v3 and added the defect (TF02013003) to our bug list to be fixed for next releases. Using latest v2 release I couldn't use Add method either, I had to populate shape series like this:

Code: Select all

				shpPyramid.X0 = dtSD.ToOADate();
				shpPyramid.Y0 = counter - dblScale;
				shpPyramid.X1 = dtSDP1.ToOADate();
				shpPyramid.Y1 = counter + dblScale;

Posted: Thu Apr 24, 2008 1:19 pm
by 14645398
Hi,

Thanks for the update. Since we need to get something working now, would your X,Y example work? I did give that a try before without success. Did you get it to work in my example?

Thanks for your help.

Posted: Fri Apr 25, 2008 12:51 pm
by narcis
Hi SDO,

We have just fixed the issue in v3 and now your code works as expected. Next TeeChart for .NET v3 maintenance release is expected to be out on early May.

In the meantime, a workaround is creating the series at designtime.

Posted: Fri Apr 25, 2008 8:46 pm
by 14645398
Hi Narcis,

Thanks for letting us know there is some light at the end of the tunnel. :D
Unfortunately, we can't produce the chart at designtime.
Since we did pay for the source, would there be a way we could get the fix before the maintenance release?

Thanks!

Posted: Mon Apr 28, 2008 9:00 am
by narcis
Hi SDO,

Ok, I've just sent you current Shape.cs with the bug fix.