开发者

Delphi histogram component?

开发者 https://www.devze.com 2023-04-10 03:50 出处:网络
Does it happen that no one ever needs histogram in Delphi ? Google gave me a bunch of half-baked code snippets. But it means that each time you need one - you have to invent one more ad hoc bycicle.

Does it happen that no one ever needs histogram in Delphi ?

Google gave me a bunch of half-baked code snippets. But it means that each time you need one - you have to invent one more ad hoc bycicle.

Torry mostly told me about some very expensive closed source Math Statistics or Financial packages, that as a subproduct have histograms. But they are very expensive and since you have no source code, each time you install update onto IDE/RTL/VCL you're probably screwed, until the vendor would make (soon ? ever?) updated packages. Given thatvendor is still does exists.

S.O. told me nothing, nil.

For what i found... Mitov.com provides some histograms in PlotLab. which told to be free for non-commercial. Alas, it is again closed-source, and if the Histogram - quite fancy let's admit -is the onlything i need from it - why pay the whole price ?

One more example http://DSpatial.sf.net Just few 开发者_如何学Cyears ago i used it in Delphi 5, but even then i felt the author is loosing interest in the project. I made few enhancement, fixed some bugs, he merged them and that's all. The component was not very useful and lacked upon features, yet better than nothing. Now the project seems to be completely dead. Good old days, etc. But i do not want them back :-)

And Stack Overflow seemingly carries no single question about it. But maybe just no one bothered to create topic, after search found nothing ? I mean, Delphi was created for database access, histograms are one of basic ways to visualize data, and no one crosses them ? Something with nice style, with rich mouse tooltip like in HTML/CSS/JS on http://www.moskva.fm/stations/FM_95.2 ?

Or is this too domain-related and not ever possible to have good abstraction ?


TChart is a control that ships with most versions of Delphi. TChart can be used to make histograms (bar charts) in style. The following give you some ideas about how to use it: http://www.digitalcoding.com/tutorials/delphi/Simple-steps-to-create-Delphi-chart.html and http://delphi.about.com/od/adptips2006/qt/chart_selectbar.htm .

If you need something with code, google the pages at delphiforfun.org/programs/oscilloscope.htm . These are not controls. The oscilloscope article has a histogram with source. Some of the other projects at the site have other histogram graphs with source..not elegant but useful and free. Use them as a template to make your own control.

The link at http://delphiforfun.org/programs/Math_Topics/probability_distributions.htm shows how to make your own statistics displays with "histograms." This example makes use of TChart.

Here is some more stuff to try I found looking at my resource file:
http://wiki.lazarus.freepascal.org/TAChart, http://members.home.nl/mvanwesten/en_lazarus.html , http://www.martinole.org/TAChart.html ...some of these are GPU components that supposedly work with some versions of Delphi. Perhaps this is your lucky day as there is some source code. The first and third listed probably will work reasonably for histograms. You may have to write your own statistics algorithms.


Found this thread while doing some searching. The ImageEn component suite has a THistogramBox component. It's the NOT prettiest thing in the world, but it's the only one I've found so far. http://www.imageen.com


I came across a histogram example in a gdiplus package available for download from code central. I don't know if it will do what you need but when I saw it I remembered your SO question.

HTH.


If you were using firemonkey, you could just created a series of TRectangles in series. They can be made unclickable by turning hittest off. Or is that too easy and straightforward?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号