Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Chart Control
  New Posts New Posts RSS Feed - [DEMO] Charting with ReportControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[DEMO] Charting with ReportControl

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

Joined: 29 January 2008
Status: Offline
Points: 2187
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Topic: [DEMO] Charting with ReportControl
    Posted: 21 March 2011 at 9:37am
Hi,
 
This is exactly what I needed and maybe usable for other members as well Wink 
 
My original idea was to have a legend that would be scrollable because I have a lot of 'items' added to the ChartControl and you all know that's a PITA... The more items you have, the smaller the area gets to render the chart. I knew I needed Markup to get the legend    
drawn so I had two options, the CJ PropertyGrid control and the ReportControl. I chose the ReportControl (because this is still my favorite control hehehe) and while I'm trying to implement it I came up with the idea using the RC as data for the Charts.
 
Using RC for this I have following options at my disposal
  • No need for loading data again and again and again to render the charts
  • Sorting
  • Grouping 
  • BeforeDrawRow event to draw legend

Heeee Lamp I have DrawItem event as well...  If I'm not mistaken ChartControl has PrintToDC hDC .... method. Yes, could use that to render a chart into a ReportItem. That's when this DEMO came to 'life' I had reanimate it a few times and currently it's going a little better, only artificial respiration is needed  Wink

And who knows this will be solved (read: IMPLEMENTED LOL) by one of the CJ developers.
 
There are a few known problems, most of them I commented but if there are more, I would like to know it as well. So, if you would run into a problem or have an idea (or two), you could use this post to discuss it. The code is a bit messy but hey!!!, it's a DEMO, right? If someone feels like putting it all into a reusable class, be my guest Wink 
 
This DEMO is mostly to keep the CJ developers awake LOL In my opinion this would be THE implementation of the year. It isn't hard as you can see in the code, just plain old VB code. You don't have to be a rocket scientist to understand it. Commented most of the code, so...
 
Following options are included in the DEMO:
 
  • ReportControl is used for adding data (I only added few records to show what it does)
  • Able to sort, group and filter, data which will be used to add points to a SINGLE serie (maybe there will be a sequel to this demo...)
  • Able to draw in a single ReportItem or as PreviewItem (not much of a difference though, see for youself)
  • Legend is drawn in a ReportItems with Markup (Only created 3 out of ?? because my Markup is poor)
  • Select a different 'Palette' and ColorEach option.
  • Option to set custom height.
  • Custom contextmenu for RC (grouping and columns visibilty) Long time ago, I requested a customization property like we already have with Statusbar.
  • And last but not least able to have PrintPreview (didn't test printing yet) with multiple pages (used the ReportControl printpreview)
edit: You can't use 3D charts to render chart in ReportControl because .PrintToDC isn't implemented (yet)
 
That's about it, maybe you have suggestions or ideas that could be used to enhance this demo, so feel free to reply in this post.
Here it is...
 
 
 
 
 
 
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: 1335
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 21 March 2011 at 10:22am
Nice demo!

One thing that the demo illustrates (IMHO) is the ability to set the vertical and horizontal alignment of a chart. For example, it would nice to be able to align the pie chart to the top of the available space rather than the middle.  I have a similar issue with one of my projects where I would like the pie chart to be aligned to the left of the available space rather than the center. A minor issue, but it would still be nice to have control over the chart alignment.


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

Language: Visual Basic 6.0 SP6

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.064 seconds.