Hi,
This is exactly what I needed and maybe usable for other members as well
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 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
And who knows this will be solved (read: IMPLEMENTED ) 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
This DEMO is mostly to keep the CJ developers awake 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...
http://forum.codejock.com/uploads/3701/ChartingWithReportControl.zip - uploads/3701/ChartingWithReportControl.zip
------------- 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....
|