Low perfomance

TeeChart for ActiveX, COM and ASP
Post Reply
Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Low perfomance

Post by Igor » Wed Oct 29, 2014 11:10 am

Hello,
I'm using TeeChart 2014 ActiveX in IE 11.
I'm plotting Point3D chart with 249 series in it.

1) Problem with perfomance. When I try to rotate chart it doesn't move smoothly. Is this because of the amount of series?
2) Fullscrenn tool.
a. When I activate it on this chart I can't rotate it, only move left and right and zoom. Is there a way to overcome this?
b. I have custom axis labels on bottom axis. But in fullscreen mode they disappear and I see axis values instead.
I'll upload example later if there is need for it.
Thanks in advance

Pep
Site Admin
Site Admin
Posts: 3301
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: Low perfomance

Post by Pep » Fri Oct 31, 2014 10:10 am

Hello Igor,
1) Problem with perfomance. When I try to rotate chart it doesn't move smoothly. Is this because of the amount of series?
Yes, due to the nunber of Series and calculations it has to do at the time to repaint during the rotation this could affect, however, there're some tricks you could use in order to improve the performance on rotate : You should consider which parts of the Chart might be customized, for example does all the axis grid pens have to be drawn ? it's possible to set a bigger increment for each axis ? I'm not sure how many points each series contains. It's difficult to say without an example.
2) Fullscrenn tool.
a. When I activate it on this chart I can't rotate it, only move left and right and zoom. Is there a way to overcome this?
Have you tried to disable the Chart panning once the FullScreen tool is used ?
TChart1.Panning.Active = False
b. I have custom axis labels on bottom axis. But in fullscreen mode they disappear and I see axis values instead.
I'll upload example later if there is need for it.
Which code are you using to customize the axis labels ? Please let me know in order to test it here and try to find a solution.

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Low perfomance

Post by Igor » Fri Oct 31, 2014 11:23 am

Hello,
Thank you for your response.
1) Each serie has 2 points, 249 series, all this in 3D. Series are connected to each other, forming tree structure. I have to use different serie for each 2 points to implement multiple branches from each point in 3D space and to color each branch differently.
Axis properties are already customized, so I can't play with them. Unfortunately I can't upload example right now, because there are a lot of private buisiness data inside.

2) a. When I try to set TChart1.Panning.Active propert, I get an error. In web console I see that Chart1.Panning is an empty object and has no Active property.
b. I use Chart1.axis.bottom.labels.add(1, "Label text"). After this I see "Label text" as bottom label, but in fullscreen mode I see 1.

Pep
Site Admin
Site Admin
Posts: 3301
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: Low perfomance

Post by Pep » Fri Oct 31, 2014 11:33 am

Hello Igor,

ok, we could try to create a similar example here, I'd appreciate if you can post the code where the Chart is created and populated, the data part can be removed and just use the SeriesX.FillSampleValues(2) method. This way we will be able see which Seires type are you using,properties and customization and try to reproduce the problem here.

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Low perfomance

Post by Igor » Fri Oct 31, 2014 12:42 pm

Hello again, I tried to upload example in .tee or .html format, but it's not allowed. What format it should be?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Low perfomance

Post by Yeray » Mon Nov 03, 2014 12:53 pm

Hi,
Igor wrote:I tried to upload example in .tee or .html format, but it's not allowed. What format it should be?
You can post your files at our upload page or directly attach them in this forum (you may have to put them into a zip file before)
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Low perfomance

Post by Igor » Wed Nov 05, 2014 7:40 am

Here's an example
Attachments
ExampleFor Steema.zip
(4.92 KiB) Downloaded 1531 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Low perfomance

Post by Yeray » Wed Nov 05, 2014 12:58 pm

Hello Igor,

After looking at your example, I see you are adding a new series for each segment or point you want to draw, even if there are cases where you could reuse a series. I've added a quite simple code trying to identify what series can be removed adding the necessary points to a series sharing the same key properties and reduced from 249 to 185 series:

Code: Select all

		for (i=0; i<Chart1.SeriesCount; i++) {
			Chart1.Series(i).Marks.Visible = false;
			
			if (Chart1.Series(i).Count > 1) {
				for (j=i+1; j<Chart1.SeriesCount; j++) {
					if ((Chart1.Series(i).Color == Chart1.Series(j).Color) &&
						(Chart1.Series(i).pen.style == Chart1.Series(j).pen.style) &&
						(Chart1.Series(i).pen.Width == Chart1.Series(j).pen.Width) &&
						(Chart1.Series(j).Count > 1) &&
						(Chart1.Series(i).XValues.Value(Chart1.Series(i).Count-1) == Chart1.Series(j).XValues.Value(0)) &&
						(Chart1.Series(i).YValues.Value(Chart1.Series(i).Count-1) == Chart1.Series(j).YValues.Value(0)) &&
						(Chart1.Series(i).asPoint3D.ZValue(Chart1.Series(i).Count-1) == Chart1.Series(j).asPoint3D.ZValue(0))) {
				
						for (m=1; m<Chart1.Series(j).Count; m++) {				
							Chart1.Series(i).asPoint3D.addXYZ(Chart1.Series(j).XValues.Value(m), Chart1.Series(j).YValues.Value(m), Chart1.Series(j).asPoint3D.ZValue(m), "", Chart1.Series(j).Color);
						}
						
						Chart1.RemoveSeries(j);
						j=j-1;
					}
				}
			}
			else if (Chart1.Series(i).Count == 1) {
				for (j=i+1; j<Chart1.SeriesCount; j++) {
					if ((Chart1.Series(j).Count == 1) &&
						(Chart1.Series(i).asPoint3D.Pointer.style == Chart1.Series(j).asPoint3D.Pointer.style) &&
						(Chart1.Series(i).asPoint3D.Pointer.horizontalSize == Chart1.Series(j).asPoint3D.Pointer.horizontalSize) &&
						(Chart1.Series(i).asPoint3D.Pointer.verticalSize == Chart1.Series(j).asPoint3D.Pointer.verticalSize)) {
						
						Chart1.Series(i).asPoint3D.LinePen.Visible = false;
						Chart1.Series(i).asPoint3D.addXYZ(Chart1.Series(j).XValues.Value(0), Chart1.Series(j).YValues.Value(0), Chart1.Series(j).asPoint3D.ZValue(0), "", Chart1.Series(j).Color);
						
						Chart1.RemoveSeries(j);
						j=j-1;
					}
				}
			}
		}
Also note I've hidden the Marks for all the series in the code above, just to check the difference in the performance.
Other tips that make a difference in the performance are:
- Using GDI instead of GDiPlus:

Code: Select all

Chart1.aspect.gdiplus.active = false;
- Disabling some gradients:

Code: Select all

Chart1.Panel.Gradient.Visible = false;
Chart1.Walls.Back.Gradient.Visible = false;
- Completely hiding walls:

Code: Select all

Chart1.Walls.Visible = false;
- Setting a bigger increment to draw less labels and grid lines. Ie:

Code: Select all

Chart1.axis.left.increment = 10;
- Hiding grid lines. Ie:

Code: Select all

Chart1.Axis.Bottom.GridPen.Visible = false;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Low perfomance

Post by Igor » Wed Nov 05, 2014 2:15 pm

Thanks for response, Yeray. Unfortunately we can't corrupt current view by removing marks or grids but we'll follow your advice to delete repeated series. Current code is generated automatically by our business app, so we'll insert deletion as postprocessing. It improves perfomance a little bit.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Low perfomance

Post by Yeray » Thu Nov 06, 2014 10:48 am

Hi Igor,

Some extra tips you could try:

- Make walls visible but transparent to keep drawing the frames:

Code: Select all

Chart1.Walls.Back.Transparent = true;
Chart1.Walls.Left.Transparent = true;
Chart1.Walls.Bottom.Transparent = true;
- Hide the axes pen:

Code: Select all

Chart1.Axis.Left.AxisPen.Visible = false;
Chart1.Axis.Bottom.AxisPen.Visible = false;
- Hide the axes MinorTicks:

Code: Select all

Chart1.Axis.Left.MinorTicks.Visible = false;
Chart1.Axis.Bottom.MinorTicks.Visible = false;
Ah, and maybe hide the Pointer.Pen on some series:

Code: Select all

		for (i=0; i<Chart1.SeriesCount; i++) {			
			if (Chart1.Series(i).asPoint3D.Pointer.style != 6) {
				Chart1.Series(i).asPoint3D.Pointer.Pen.Visible = false;
			}
		}
In short, it consists on avoid drawing as much elements as possible to win speed.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Igor
Newbie
Newbie
Posts: 16
Joined: Fri Jul 18, 2014 12:00 am

Re: Low perfomance

Post by Igor » Tue Nov 11, 2014 8:06 am

Hi,
So questions:
1) Minimizing number of series helps to imrove perfomance a little bit, other tips even applied together don't make any significant difference. Since we have graphs that have even more series than in example, the perfomance isn't as good as we expected it to be. Is it planned to do something in future releases that will improve the perfomance?
2)We are also interested in building such types of graphs in Javascript/HTML5 component. Is it planned to make support for it?
3)The problem with rotation in fullscrenn mode isn't solved. TChart1.Panning.Active = False doesn't work. Is there a solution?
4)The problem with custom axis labels in fullscreen mode isn't solved too.
Thanks for your help

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Low perfomance

Post by Yeray » Tue Nov 11, 2014 11:23 am

Hello Igor,
Igor wrote: 1) Minimizing number of series helps to imrove perfomance a little bit, other tips even applied together don't make any significant difference. Since we have graphs that have even more series than in example, the perfomance isn't as good as we expected it to be. Is it planned to do something in future releases that will improve the perfomance?
First note TeeChart ActiveX is a wrapper from the VCL version so, in general, any change in the second is automatically inherited in the first.
Also note the response of an application depends on many factors from the number of points to be drawn and the refresh interval to the extra decorations being drawn (gradients, grid lines, texts,...), the Framework being used and the specs of the target machine.
In your case, you don't have so many points (I count 432 points after reducing the number of series&points with my suggestion above) but rotating the chart makes it to be repainted many times.
We always try to keep TeeChart versions as fast as possible, adding new features with care to find a good compromise with the performance. I've tried your application with v8 and I think it worked a bit smoother with it, so you can give it a try. To do it, having TeeChart ActiveX v8 registered in the machine, change your onLoadFunc to use the appropriate CLSIDs:

Code: Select all

<BODY onload=onLoadFunc()>
	<OBJECT id=Chart1 style="HEIGHT: 93%" classid=CLSID:BDEB0088-66F9-4A55-ABD2-0BF8DEEC1196></OBJECT>
	<DIV id=foot>
		<OBJECT id=Commander1 classid=CLSID:DCAB77D9-709F-4BB0-92B9-5CFE7A5170EB></OBJECT>
	</DIV>
</BODY>
At the moment, I'm afraid I can't think on any extra tip nor in a feature to be coming that would improve the response of your application.
Igor wrote: 2)We are also interested in building such types of graphs in Javascript/HTML5 component. Is it planned to make support for it?
We don't plan to add 3D to TeeChart Javascript/HTML5.
Igor wrote: 3)The problem with rotation in fullscrenn mode isn't solved. TChart1.Panning.Active = False doesn't work. Is there a solution?
We don't recommend to give access to the Editor (nor to the Commander) the end-user.
If you use the Rotate Tool instead of using the Rotate feature in the Commander, it works fine in conjunction with FullScreen tool:

Code: Select all

	rotate = Chart1.Tools.Add(7); //tcRotate Tool
	fullScreen = Chart1.Tools.Add(43); //tcFullScreen Tool
	Chart1.Tools.Items(fullScreen).Active=true;
Igor wrote: 4)The problem with custom axis labels in fullscreen mode isn't solved too.
I've reproduced it in a simple application so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=998
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Low perfomance

Post by Yeray » Fri Jun 19, 2015 7:29 am

Hello,
Yeray wrote:I've reproduced it in a simple application so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=998
This is just to let you know we closed this ticket since we couldn't reproduce it any more with the latest version available at the customer area (v2015.0.0.2).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply