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
murthymsr
  • Members
  • 68 posts
  • Last active: Nov 11 2015 04:34 PM
  • Joined: 19 Apr 2011
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.
Maybe I'll do it once... Multi lines in one chart should be supported too.

Thanks.


My AHK version is AHK_L since Aug, 2012.
My OS: XP SP3

tomjuggler
  • Members
  • 12 posts
  • Last active: Dec 04 2014 09:37 PM
  • Joined: 17 Feb 2011

Awesome! Eye candy cool.png

 

Thanks for sharing! 



lukethespook
  • Members
  • 5 posts
  • Last active: Mar 14 2013 11:56 PM
  • Joined: 15 Feb 2013

Brilliant. Congrats and thank you.



kostons
  • Members
  • 5 posts
  • Last active: Mar 11 2016 04:36 PM
  • Joined: 13 Sep 2013

Very Nice!!

 

Is it possible to get the output into a html  page?

 

it would be great if it could  work with the code below.

 

thanks!

 

 

filedelete %A_ScriptDir%\printout.htm
htmlhead
=
(
<html><head><title>printout</title>
<style type="text/css" media=screen,print>
<!--
body,td,H1 {font-family: "arial";font-size: 11pt}
// -->
</style></head>
<body><h1><br>Drives<br></h1>
<table align=left border=0 width=50`%>
)
fileappend, %htmlhead%, %A_ScriptDir%\printout.htm
objWMIService := ComObjGet("winmgmts:\\.\root\cimv2")
colItems := objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk")._NewEnum
while colItems[objItem]
    {
    a := objItem.Caption, b := objItem.FileSystem, c := Round((objItem.Size / (1024 ** 3)), 2)
    d := Round((objItem.FreeSpace / (1024 ** 3)), 2), e:= Round((100 * (objItem.FreeSpace / objItem.Size)), 2)
    htmlbody =
    (
    <tr><td width=100`
%>Drive: %a% </td></tr>
    <tr><td>File System: %b%</td></tr>
    <tr><td>Drive Size: %c% GB</td></tr>
    <tr><td>Free Space: %d% GB</td></tr>
    <tr><td>Free Space: %e% `%</td></tr><tr><td>-----------------------------</td></tr>
    )
    fileappend, %htmlbody%, %A_ScriptDir%\printout.htm
    }
fileappend, </font></table></body></html>, %A_ScriptDir%\printout.htm
Runwait, %A_ScriptDir%\printout.htm



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

Is it possible to get the output into a html page?

Yes. Save Bar chart to a file and than use it in html document. Example below shows how to save Bar chart to a .png file:

ChartData =
(
Mike	24
Jenny	22
Steve	27
Marry	23
)

pToken := Gdip_Startup()				; start up GDI+
pBitmap := BarChart(ChartData, 250, 120)		; create BarChart bitmap
Gdip_SaveBitmapToFile(pBitmap, A_ScriptDir "\Test.png")	; save a bitmap to a file
Gdip_DisposeImage(pBitmap)				; dispose of bitmap
Gdip_Shutdown(pToken)					; shut down GDI+
ExitApp

#Include Gdip.ahk		; by Tic
#Include BarChart.ahk		; by Learning one

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


kostons
  • Members
  • 5 posts
  • Last active: Mar 11 2016 04:36 PM
  • Joined: 13 Sep 2013

 

Yes. Save Bar chart to a file and than use it in html document. Example below shows how to save Bar chart to a .png file:

ChartData =
(
Mike	24
Jenny	22
Steve	27
Marry	23
)

pToken := Gdip_Startup()				; start up GDI+
pBitmap := BarChart(ChartData, 250, 120)		; create BarChart bitmap
Gdip_SaveBitmapToFile(pBitmap, A_ScriptDir "\Test.png")	; save a bitmap to a file
Gdip_DisposeImage(pBitmap)				; dispose of bitmap
Gdip_Shutdown(pToken)					; shut down GDI+
ExitApp

#Include Gdip.ahk		; by Tic
#Include BarChart.ahk		; by Learning one

thanks, gonna try it



capbat
  • Members
  • 191 posts
  • Last active: Feb 08 2017 06:57 PM
  • Joined: 29 Nov 2007

Hi
 
I am trying to do this but instead of providing the chartdata directly I want to use the FileRead Command to read in a file into ChartData
The files contains the following.

 

0413      31

0414      45

0415      34

 

Etc Two colums separated by tab and ended by `n.

Then I use the command.

FileRead, CharData, Results.txt

 

The graphic shows only the first colum's data not the second one.

 

Any Suggestions.

 

thanks.

 

Bat



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

Instead of

FileRead, CharData, Results.txt

use

FileRead, ChartData, *t Results.txt

*t option replaces any/all occurrences of carriage return & linefeed (`r`n) with linefeed (`n).


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