Print Page | Close Window

COM - VB - XAML Scroll Chart Demo

Printed From: Codejock Forums
Category: General
Forum Name: Samples and Demo Applications
Forum Description: Post your samples and demo applications here.
URL: http://forum.codejock.com/forum_posts.asp?TID=11037
Printed Date: 23 November 2024 at 11:20pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: COM - VB - XAML Scroll Chart Demo
Posted By: jpbro
Subject: COM - VB - XAML Scroll Chart Demo
Date Posted: 14 June 2008 at 5:45pm
I was experimenting with XAML/Markup and decided to try my hand at a scrolling line chart (something that could be useful in a bandwidth monitor, for example). The first thing I noticed was that the current XAML implementation doesn't seem to support antialiased line drawing (I'd like to be proved wrong on this though!), so I decided to fake it by drawing multiple lines of decreasing thickness and lightness.

Once I got to this point, I figured I would make it respond to size & maximum value changes as well, and then why not post it here as a demo for anyone who might have a need for such a thing...

The project includes an option to pause the scroller & toggle the fake antialiasing...this allows you to easily see the difference between the plain XAML polyline, and the smoothed one.

uploads/20080614_214616_XamlScrollChart.zip - uploads/20080614_214616_XamlScrollChart.zip

 
Output:
 



Testing Results:

Well, my tests seem to indicate that 50000 points are too many. I'm not sure what the limit is, but there is a byte length limit for the Points attribute of the Polyline element. Exceeding this cause the markup to be considered invalid.

You *might* be able to string multiple Polyline elements together to apppear as a single line however...I haven't tried this yet.

You can draw multiple lines of different colours, and add a scrollbar to the chart however. Here's a basic (and admittedly ugly) sample:

uploads/20080618_212449_XamlLongChart.zip - uploads/20080618_212449_XamlLongChart.zip
 
 
Output:
 



Enjoy (comments, questions and improvements are welcome!):



Replies:
Posted By: jpbro
Date Posted: 14 June 2008 at 9:46pm
I updated the project to include an option to pause the scroller & toggle the fake antialiasing...this allows you to easily see the difference between the plain XAML polyline, and the smoothed one.

uploads/20080614_214616_XamlScrollChart.zip - uploads/20080614_214616_XamlScrollChart.zip

 
Output:
 


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Oleg
Date Posted: 15 June 2008 at 8:26am
nice :)
 
btw, we plan to add GDI+ drawing for Polyline/Ellispe/Polygon to have real antialiasing for the 12.1.0 release.


Posted By: Aaron
Date Posted: 18 June 2008 at 10:32am
Originally posted by jpbro jpbro wrote:

    
Enjoy (comments, questions and improvements are welcome!):
 
Comments:
Improvements: not yet, maybe in the future
Questions:
  • I see you use "points" to draw the line, if I would have an array (lets say 50000 (x,y for each line) can I use all "points" to draw a line?
  • Would it be possible to have a chart with multiple lines and different color for each line
  • Have scrollbars to scroll to a position you want?
 
Thanks in advance


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: jpbro
Date Posted: 18 June 2008 at 8:07pm
Hi Aaron,

Glad you like the demo! As for your questions:

1) I'm not sure if there is a limit to the numbers of points you can use for drawing, I will experiment
2) Multiple lines of different colours should be no problem at at (just using multiple Polyline elements with different Foreground attributes)
3) There is a ScrollViewer element that allows you to scroll around, so it should be possible...

I'll give it a try and see what I can do.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 18 June 2008 at 9:26pm
Well, my tests seem to indicate that 50000 points are too many. I'm not sure what the limit is, but there is a byte length limit for the Points attribute of the Polyline element. Exceeding this cause the markup to be considered invalid.

You *might* be able to string multiple Polyline elements together to apppear as a single line however...I haven't tried this yet.

You can draw multiple lines of different colours, and add a scrollbar to the chart however. Here's a basic (and admittedly ugly) sample:

uploads/20080618_212449_XamlLongChart.zip - uploads/20080618_212449_XamlLongChart.zip
 
 
Output:
 



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Oleg
Date Posted: 21 June 2008 at 1:45am
Chart with Markup is good idea to demonstrate Markup options.
 
Here from 12.0.1 release:
 
https://forum.codejock.com/uploads/20080621_014516_Markup.zip - Markup.zip  
 
Jason, Thanks for playing with Markup.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jpbro
Date Posted: 21 June 2008 at 3:45pm
Hi Oleg,

Thanks for the PDF...the charts look great with GDI+, so I definitely look forward to the 12.0.1 release! I saw it mentioned in another post that 12.0.1 was going to be out end of this week, but that has come and gone...Is it expected soon? I have a demo on Thursday, so a day or 2 in advance of that would be very good (assuming it's close)...

Thanks.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Oleg
Date Posted: 22 June 2008 at 2:39am
Hi,
 
No, GDI+ will be added in 12.1.0 release :-(. 12.0.1 is maintance and will have only fixes.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Aaron
Date Posted: 24 June 2008 at 9:59am

 
jpbro said: I was experimenting with XAML/Markup and decided to try my hand at a scrolling line chart (something that could be useful in a bandwidth monitor, for example). The first thing I noticed was that the current XAML implementation doesn't seem to support antialiased line drawing (I'd like to be proved wrong on this though!), so I decided to fake it by drawing multiple lines of decreasing thickness and lightness.
    Once I got to this point, I figured I would make it respond to size & maximum value changes as well, and then why not post it here as a demo for anyone who might have a need for such a thing...
Enjoy (comments, questions and improvements are welcome!)
(NOTE: Updated project below)
 
jpbro said
I updated the project to include an option to pause the scroller & toggle the fake antialiasing...this allows you to easily see the difference between the plain XAML polyline, and the smoothed one.
Oleg said
nice :)
btw, we plan to add GDI+ drawing for Polyline/Ellispe/Polygon to have real antialiasing.
 
Aaron said:
Comments:
Improvements: not yet, maybe in the future
Questions:
  • I see you use "points" to draw the line, if I would have an array (lets say 50000 (x,y for each line) can I use all "points" to draw a line?
  • Would it be possible to have a chart with multiple lines and different color for each line
  • Have scrollbars to scroll to a position you want?
Thanks in advance
 
jpbro said:
Hi Aaron,

Glad you like the demo! As for your questions:

1) I'm not sure if there is a limit to the numbers of points you can use for drawing, I will experiment
2) Multiple lines of different colours should be no problem at at (just using multiple Polyline elements with different Foreground attributes)
3) There is a ScrollViewer element that allows you to scroll around, so it should be possible...

I'll give it a try and see what I can do.
 
jpbro said:
Well, my tests seem to indicate that 50000 points are too many. I'm not sure what the limit is, but there is a byte length limit for the Points attribute of the Polyline element. Exceeding this cause the markup to be considered invalid.

You *might* be able to string multiple Polyline elements together to apppear as a single line however...I haven't tried this yet.

You can draw multiple lines of different colours, and add a scrollbar to the chart however. Here's a basic (and admittedly ugly) sample:
 
Oleg said:
Chart with Markup is good idea to demonstrate Markup options.
 
Here from 12.0.1 release:
 
https://forum.codejock.com/uploads/20080621_014516_Markup.zip - Markup.zip  
 
Jason, Thanks for playing with Markup.
 
jpbro said:
Thanks for the PDF...the charts look great with GDI+, so I definitely look forward to the 12.0.1 release! I saw it mentioned in another post that 12.0.1 was going to be out end of this week, but that has come and gone...Is it expected soon? I have a demo on Thursday, so a day or 2 in advance of that would be very good (assuming it's close)...

Thanks.
 
Oleg said:
No, GDI+ will be added in 12.1.0 release :-(. 12.0.1 is maintance and will have only fixes.



-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net