Codejock Forums Homepage
Forum Home Forum Home > General > XAML Snippets > Samples and Demo Applications
  New Posts New Posts RSS Feed - COM - VB - XAML Scroll Chart Demo
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

COM - VB - XAML Scroll Chart Demo

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: COM - VB - XAML Scroll Chart Demo
    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

 
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
 
 
Output:
 



Enjoy (comments, questions and improvements are welcome!):
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

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

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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
 
 
Output:
 

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

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 June 2008 at 1:45am
Chart with Markup is good idea to demonstrate Markup options.
 
Here from 12.0.1 release:
 
 
Jason, Thanks for playing with Markup.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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:
 
 
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....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.