![]() |
COM - VB - XAML Scroll Chart Demo |
Post Reply ![]() |
Author | |
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() 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!): |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
nice :)
btw, we plan to add GDI+ drawing for Polyline/Ellispe/Polygon to have real antialiasing for the 12.1.0 release.
|
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Comments:
![]() Improvements: not yet, maybe in the future
![]() Questions:
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.... |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
|
|
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.... |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |