An ActiveX Control to Display Distribution Graphs

Environment: VC6 SP3, NT4 SP3

This ActiveX control is intended to display a distribution graph of numerical datas. The datas are split among a set of constant intervals. The horizontal axis displays the interval values. The vertical axis shows the number of occurences (percentage) of numerical datas in each interval.

Each data is combined with a date. When the user clicks on one of the vertical bars, a small windows displays all the couples (value,date) bounded be the interval.

The user of the control is allowed to specify :

  • either the interval value either the number of intervals (these two values are related),
  • a display unit (unity, thousand or million),
  • the background color,
  • the vertical bars color

There is little chance this control meets your need. But it can help you if you have something similar to do.

The source project contains two ATL objects :

  • the control itself (CDistributionGraph)
  • a simple ATL object used to store historical datas (CHistoricalDatas)

HistoricalDatas contains the following methods and properties :

AddEntry( DATE date, double value) Add a couple (date,value) in the historic
long     Length Return number of datas
double Value(long index ) Get value at specified index
DATE Date(long index )  Get date at specified index

DistributionGraph contains the following methods and properties :

HistoricalDatas Set/Get the historical datas
double Interval Set/Get the interval value
long IntervalCount Set/Get the number of intervals
Units DisplayUnits Set/Get the display unit (One,Thousand or Million)

The two demo project (VB and VC++) show how to populate the control. The VC++ project contains two wrapper classes (CHistoricalDatas and CDistributionGraph) which have been generated by ClassWizard using Project|Add to Project|Components and control

Sample Visual Basic code


Dim hDatas As New HistoricalDatas
Dim d As Date
Dim v As Double
d = Date
For i = 0 To 200
    v = Rnd(1) * 10000
    hDatas.AddEntry DateAdd("d", i, d), v
Next i
DistributionGraph.HistoricalDatas = hDatas

Sample VC++ code

fHistoricalDatas.CreateDispatch("DGraph.HistoricalDatas.1") ;
COleDateTime date = COleDateTime::GetCurrentTime();    ;
const COleDateTimeSpan oneDay( 1, 0, 0, 0 ) ;

for ( int i = 0 ; i < 200 ; i++ )
	fHistoricalDatas.AddEntry( date, (10000*::rand())/RAND_MAX ) ;
	date += oneDay ;
fGraph.SetFillColor( RGB( 255, 0, 0 ) ) ;
fGraph.SetBackColor( ::GetSysColor( COLOR_WINDOW ) ) ; 
fGraph.SetHistoricalDatas( fHistoricalDatas ) ;
fGraph.SetDisplayUnits( 0 ) ;


Download Visual Basic demo project - 7 Kb
Download Visual C++ demo project - 17 Kb
Download source - 59 Kb

Note : Before executing demo projects, the ActiveX control must first be registered (compile it or use regsvr32).


  • グッチ グッチ 財布 グッチ バッグ コーチ コーチ バッグ コーチ 財布

    Posted by scgchurtis on 07/19/2013 06:00pm

    クロエ アシスタント兼任 ルイヴィトン 財布 誹謗Jr ミュウミュウ 財布 ^^ グッチ ムスクなどがゴージャスでセクシー [url=]ミュウミュウ[/url] [url=]ミュウミュウ 財布[/url] miumiu 財布 クロエ 新作 ルイヴィトン 新作 シャネル 財布 プラダ アウトレット chanel 財布 プラダ ルイヴィトン コーチ プラダ バッグ 新作

  • ihpgqsdpl

    Posted by Allonnanvam on 06/26/2013 09:40am

    rzjddqzmf コーチ財布,コーチ アウトレット,コーチバッグ,コーチ,COACH fvggubisf

  • hot sales

    Posted by kellywhosal47 on 05/24/2013 09:44pm

    Hermes Outlet Apart from to several roles Plancha Tory Burch Cabello Plancha Tory Burch De Ceramics along with tiawan Por Mayoreo by firm on the emission, austere the many attacker catapult armed forces abstruse secret headquarters, many of the intense every one of the abstruse hq. Hermes Birkin That is why the lower the APR is, the greater it can be her or him since it indicates they have got to fork out much less fascination. Hermes Handbags The chocolate brown leather looks really classic especially with gold tone hardware all throughout. Mulberry Outlet Why not replicas? Replicas never can compare to actual Vuittons. Mulberry Gardez quipe rencontres confrences imaginatives innovantes rponses Suivant , loigner de actuellement l'entreprise propritaire prend normalement sans rapport deux mots et mix eux de faire un nouveau, beaucoup plus accrocheur mot . Mulberry Sale They will not only help you save a lot of cash to generate the different options, their families, but also can get a couple at the expense of the small proportion, in the commodity area. - hermes handbags - hermes handbags - hermes handbags With the wide variety of materials to choose from that sticks could very well be done from, it can be practical to have so much of flex from your stick. But I'm not sure I want to wear a Frank Stella, either.

  • levy mlb jerseys

    Posted by hwardevev on 04/21/2013 07:07pm

    cheap Clarisonic cleansers clarisonic sale Clarisonic cleansers outlet clarisonic outlet store cheap clarisonic sale canada cheap clarisonic mia canada cheap clarisonic sale uk clarisonic uk authentic nfl jerseys new nba jerseys

  • fake oakley sunglasses

    Posted by qgliliImpumpnom on 03/29/2013 10:11am - cheap fake oakley sunglasses fake ray ban sunglasses - ray ban sunglasses cheap oakleys cheap - cheap ray ban sunglasses discount ray ban sunglasses - fake oakley sunglasses discount ray ban sunglasses - fake ray ban wayfarer cheap sunglasses

  • Sexy Underwear

    Posted by Fishnetwr1081 on 03/29/2013 09:36am - Trashy LingerieSweep in it, dust in it, read in it Often, wholesalers, distributors or even manufacturers offer discount pricing for quantity purchases - red LingerieWhile lingerie is generally pretty forgiving size wise, (a lot of lingerie is marked one size fits all) you should know at a minimum if she's a small, medium or large Make sure to have the correct measurements and then go from there - Camouflage LingerieHowever, this is not the case today anymore Pay attention to material type (cotton, silk, etc - sexy stockingsGot a nice set of abs? Look for an outfit that reveals your mid drift The next thing that you have to consider is the design - Sexy Nurse LingeriePrices vary as per the package and choice Something else to remember is if the store offers to wrap the lingerie let them

  • Lace Chemise

    Posted by Fishnetdp1044 on 03/29/2013 07:17am - Fishnet Panty HoseAsk any woman and you will perhaps get an idea how close to the heart of a woman is lingerie Do a search on lingerie and you'll find a multitude of reputable lingerie dealers and merchants - Sexy Lingerie salethe massive appreciation she will get from her sexy undies is a whole new matter Remember that the more accurate the measurement is, the more fitted and perfect the effects of the lingerie will be - Babydoll lingerie  If you can purchase items from these ranges and you can’t go very wrong in getting your partner a present that she will enjoy wearing for a long time to comes sex appeal - Sexy ChemiseSexy lingerie is an easy way to add a sizzle into your relationship Pay attention on fabrics, quality, and selection and of course the website on its own - Fishnet BodystockingsBaby doll lingerie comes in a variety of fabrics Amongst its product inclusions are summerwear, clubwear, Halloween lane, fetish wear, men

  • cheap ray ban sunglasses

    Posted by tgliliImpumpvec on 03/28/2013 10:19pm - cheap oakleys sunglasses fake ray ban sunglasses - designer sunglasses cheap cheap oakley - discount sunglasses ray ban sunglasses cheap - oakleys for cheap cheap ray ban sunglasses - cheap aviator sunglasses fake ray ban

  • oakley sunglasses cheap

    Posted by ugliliImpumpnqw on 03/28/2013 08:30pm - wholesale oakley sunglasses cheap ray ban - wholesale oakley sunglasses cheap ray ban sunglasses - discount oakley sunglasses,,,,,o cheap oakley frogskins - wholesale designer sunglasses wholesale sunglasses - oakley discount discount oakleys

  • cheap oakleys

    Posted by cgliliImpumpoor on 03/28/2013 07:47pm - cheap ray ban discount sunglasses - replica sunglasses wholesale oakley sunglasses - oakleys cheap wholesale designer sunglasses - discount sunglasses cheap ray ban - wholesale oakley sunglasses oakley sunglasses discount

  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date