Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

BarChart


  • Please log in to reply
22 replies to this topic
Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
WARNING: This is old thread. It is continued here.

BarChart%20examples%20mini.jpg

BarChart()
- compatible with AHK_L and AHK Basic
- no globals
- has 20 built-in skins + you can make your own
- requires Gdip.ahk by Tic

Download BarChart.zip which includes: BarChart.ahk, examples, Gdip.ahk, screenshots.
Short documentation and license are in BarChart.ahk's comments. Learn from examples.
 
See also:
- Excel Charts by Xx7
- XGraph by SKAN

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
nice work as usual :)

Wicked
  • Members
  • 504 posts
  • Last active: Nov 02 2017 11:07 PM
  • Joined: 07 Jun 2008
My God. I've not had time to check it out yet, but damn it looks good!

EDIT: After trying it out... Fantastic! These are VERY well done!

3nL8f.png


sumon
  • Moderators
  • 1317 posts
  • Last active: Dec 05 2016 10:14 PM
  • Joined: 18 May 2010
I applaud you for a clean code, simple to use, good visuals. Very nice!

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
Thanks :)

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


iDrug
  • Members
  • 389 posts
  • Last active: Oct 11 2015 09:24 PM
  • Joined: 13 Oct 2009
o-some!
it would be nice to have other kinds of graphs, though:
1. vertical ones (just rotate the current ones by 90 degrees)
2. one line graphs:
Posted Image

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

vertical ones (just rotate the current ones by 90 degrees)

The newest update (which was finished 2 months ago but not released yet because of www.autohotkey.net problems) has example which demostrates vertical bar charts - column charts. You can already do it with the current version by using Gdip_RotateBitmap() function which I posted in Tic's GDI+ lib thread.

one line graphs

Maybe I'll do it once... Multi lines in one chart should be supported too.

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


m3nth0l
  • Members
  • 27 posts
  • Last active: Feb 13 2015 11:34 PM
  • Joined: 19 Oct 2011
Very awesome script! Great job.

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
Thanks.

BarChart updated: simplified usage, new possibilities, new examples.

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


Xx7
  • Members
  • 674 posts
  • Last active: Mar 24 2015 10:48 PM
  • Joined: 19 Apr 2011

Hi L1,

 

This is phenomenal!! biggrin.png  I'm really liking the "DarkT" skin.

 

Quick question for you..  without changing the bars, would it be possible to change the age "27" to "Oldest".. and age "22" to "Youngest".  Any quick way to hide the actual numbers and just have bars and text? smile.png

 

1dUn9.png

 

 

 

 

Another really "minor" adjustment that could be made is if there are negative values, the fade might look abit more symmetrical if it went the other way?? or was this your preference?

cVMYF.png



Joe Glines
  • Members
  • 118 posts
  • Last active: Jan 24 2016 03:08 PM
  • Joined: 23 Dec 2009

This is awesome!  I report on a lot of data and frequently graph it in Excel.  This opens up the possibility of doing it all in AutoHotKey!  :)


Automating the mundane 1 script at a time...
https://www.linkedin.com/in/joeglines
The-Automator

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
Thanks.
 

without changing the bars, would it be possible to change the age "27" to "Oldest".. and age "22" to "Youngest".

Such feature is not built in BarChart. What you could do is to create BarChar bitmap - pBitmap := BarChart(), than get Gdip_GraphicsFromImage(), and than overwrite part of bar where "27 & 22" are written; first with rectangle - Gdip_FillRoundedRectangle() or Gdip_FillRectangle, and than write Gdip_TextToGraphics().
 

Any quick way to hide the actual numbers and just have bars and text?

Yes. Add DisplayValues:0 in the Options parameter.
 

if there are negative values, the fade might look abit more symmetrical if it went the other way?

Hm... yes... I'll think about changing that. For now use other skins which have vertical bar gradient or use BarColorDirection:1 in  Options parameter which actually represents WrapMode in Gdip_CreateLineBrushFromRect(), and that is;
LinearGradientModeHorizontal = 0
LinearGradientModeVertical = 1
LinearGradientModeForwardDiagonal = 2
LinearGradientModeBackwardDiagonal = 3
 
 

My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


Xx7
  • Members
  • 674 posts
  • Last active: Mar 24 2015 10:48 PM
  • Joined: 19 Apr 2011

 

Yes. Add DisplayValues:0 in the Options parameter.
 
 
Perfect, this is what I was looking for!
 
 
 
Such feature is not built in BarChart. What you could do is to create BarChar bitmap - pBitmap := BarChart(), than get Gdip_GraphicsFromImage(), and than overwrite part of bar where "27 & 22" are written; first with rectangle - Gdip_FillRoundedRectangle() or Gdip_FillRectangle, and than write Gdip_TextToGraphics().
 
 
If you set DisplayValues := 0, then you could store the names and alter any text subsequent which is what I desired. Thanks!
 
UJ9qk.png

var_1 := "Steve: Oldest"
var_2 := "Jenny: Youngest"


AgeChart =
(
Mike 24
%var_1% 27
Chris 25
%var_2% 22
Marry 23
)
;....etc...

BarChart(AgeChart, "AgePic", 1, "Age", Skin, "DisplayValues:0")

 

 



Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009

Ha! icon_biggrin.gif  You know how to use BarChart() better than me! icon_cool.gif  Respect! icon_cool.gif


My Website • Recommended: AutoHotkey Unicode 32-bit • Join DropBox, Copy


Xx7
  • Members
  • 674 posts
  • Last active: Mar 24 2015 10:48 PM
  • Joined: 19 Apr 2011

L1, your script got me thinking... smile.png

 

I was looking for a way to create a graph in Excel, then show it as a GUI. Please check out my script Excel Charts, if you have time!