Jump to content
pinkfoyd

How to draw nice graph / charts

Recommended Posts

Hi all,

 

For my work, i need to produce automatically chart that i will include in my morning email.

 

First I tried the graph function of powershell with Microsoft Chart Controls , very nice looking, with help of this script : https://gallery.technet.microsoft.com/Drawing-charts-with-6ab5de4e#content

BUT is useless as i can't sort data in graph ( object array is ***** in powershell, order is random )

 

So trying back with autoit.

After lot of forum research :

 

  • RMChart : not working
  • Another script not working, or working but only in autoit GUI ( or can't find the good topic )
  • Chart.udf : nice but not in GDI so can't produce image
  • ImageMagick : possible but very hard to code the entire line

can't use excel, because can't install it on the production server.

 

 

In a perfect world i would produce this :

6.png

 

But simplest will be fine too :

1.png

 

 

Do you know an another solution, any help would be greatly appreciated.

Edited by pinkfoyd

Share this post


Link to post
Share on other sites

N.B. The Wiki is a great source for such functions. Please check the UDF page.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-03-26 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-03-21 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEXGUI (NEW 2020-03-27 - Version 1.0.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites
On 12/6/2016 at 6:28 PM, pinkfoyd said:

Hi, thanks for the reply, i found finally the solution myself, autoit and powershell...

 

example1.pngexample2.pngexample3.pngtest.png

create_chart.au3 11.83 kB · 670 downloads

Example_conf_chart.ini 416 B · 345 downloads

Can you post the _create_graph function? It isnt in, also not within the GDI module linked. You changed it? coz graphUDF says graph_create, instead of create_graph.

Share this post


Link to post
Share on other sites
51 minutes ago, mikell said:

Notsure about an answer (pinkfoyd, Last visited : December 9, 2016)

Do you know how to get those bars easily? I have multiple "examples" of a line graph, or dot-graph. But i'd also like the bars and don't know how to approach

Share this post


Link to post
Share on other sites
22 hours ago, notsure said:

Can you post the _create_graph function?

I looked into it and the function is within the create_chart.au3 file.  It is based on PowerShell 1.0.  In order to use it you must install the right assembly (System.Windows.Forms.DataVisualization.Charting.Chart) and enable powershell script.

Share this post


Link to post
Share on other sites
4 hours ago, Nine said:

I looked into it and the function is within the create_chart.au3 file.  It is based on PowerShell 1.0.  In order to use it you must install the right assembly (System.Windows.Forms.DataVisualization.Charting.Chart) and enable powershell script.

I have seen that yes, but i get no error whatsoever, only "example.png not found", so for some reason it won't create it, eventho if i start it with admin rights.

Share this post


Link to post
Share on other sites

If you have Excel installed I suggest to have a look at the ExcelChart UDF (please check my signature).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-03-26 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-03-21 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEXGUI (NEW 2020-03-27 - Version 1.0.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites
13 minutes ago, notsure said:

I have seen that yes, but i get no error whatsoever, only "example.png not found", so for some reason it won't create it, eventho if i start it with admin rights.

It means that you don't have the assembly installed.  I suggest you take a look at @water wise advice...

Share this post


Link to post
Share on other sites
On 6/14/2019 at 5:52 PM, water said:

If you have Excel installed I suggest to have a look at the ExcelChart UDF (please check my signature).

Thanks, sorry for the late reply

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AMFC
      Hello everyone,
      For a measurement application, I need to put a 2D graphic inside a tab control (inside the second tab). But I can’t get the graph to appear only in the second tab.
      Please, what am I doing wrong?  
      #include <GraphGDIPlus_UDF.au3> $ID0 = GUICreate("TEST 2D Graphic",1000,600) $idTabCAB = GUICtrlCreateTab(10,10,980,500) ; TabItem definition ************************ $TAB1 = GUICtrlCreateTabItem(" TAB 1 ") GUICtrlCreateLabel("First Tab.",50,70,400,25) ;--------------------------------------- $TAB2 = GUICtrlCreateTabItem(" TAB 2 ") GUICtrlCreateLabel("Second Tab.",50,70,400,25) GUICtrlCreateLabel("Title of the graphic",520,70,400,25) GUICtrlSetFont(-1,10,800,0,"Arial Narrow") $Graph = _GraphGDIPlus_Create($ID0,520,100,400,200,0xFF000000,0xFFE0F0FF) _GraphGDIPlus_Set_RangeX($Graph,1,52,25,1,0) _GraphGDIPlus_Set_RangeY($Graph,0,100,10,1,0) ;----- Trace the curve ----------------- TraceCurve() ;--------------------------------------- $TAB3 = GUICtrlCreateTabItem(" TAB 3 ") GUICtrlCreateLabel("Third Tab.",50,70,400,25) ;*********************************************** GUICtrlCreateTabItem(""); end tabitem definition GUISetState() While 1 Local $msg = GUIGetMsg() Select Case $msg = -3 ;[Exit] ExitLoop EndSelect WEnd ;----- close down GDI+ and clear graphic ----- _GraphGDIPlus_Delete($ID0,$Graph) GUISetState(@SW_HIDE) Exit Func TraceCurve() _GraphGDIPlus_Set_PenColor($Graph,0xFF0084FF) _GraphGDIPlus_Set_PenSize($Graph,2) _GraphGDIPlus_Plot_Start($Graph,0,0) For $X=1 to 52 Step 1 $Y = Random(1,100,1) ; Random values for example. _GraphGDIPlus_Plot_Line($Graph,$X,$Y) _GraphGDIPlus_Refresh($Graph) Next EndFunc Someone is so kind to help me.  This is my script.   thank you very much in advance.
    • By water
      Extensive library to control and manipulate Microsoft Excel charts.
      Written by GreenCan and water.
      Theads: General Help & Support - Example Scripts
      BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort

      KNOWN BUGS (last changed: 2017-07-21)
      None. The COM error handling related bugs have been fixed.
       
    • By LoneWolf_2106
      Hi everybody,
      i have a question about Excel, i have to create several charts one below the other dynamically.
      I have thought to use:
       
      $oRangeLast = .UsedRange.SpecialCells($xlCellTypeLastCell) $iRowCount = .Range(.Cells(1, 1), .Cells($oRangeLast.Row, $oRangeLast.Column)).Rows.Count  
      And then to use it in this way:
      $Graph_position = "=Test1!A"&$iRowCount+2&":K"&$iRowCount+24 But it doesn't work with charts.
      Does anyone have a suggestion?
       
    • By Kanashius
      This UDF can be used to Display bar charts in a window. I hope you can need it.
      Exampleimage:
      If you like it, please leave me a comment, also if you have any suggestions to make it better or if you found bugs.
      Chart_UDF_source.zip
    • By wakillon
      Would you Listen Last 100 Uk Top Charts singles like a JukeBox or Radio in random order and without advertising ?

      It's possible by getting charts List on charts website http://creativedisc.com/category/top-charts/uk-top-100-singles/ updated weekly
      and searching songs list on youtube.




      Changelog 1.0.6.1
      Script completly rewrited.
      All externals fils are includes.
      New youtube search engine improved for listen the good song !
      Blacklist Management improved.
      Video can be visible.
      Now flashplayer sound is muted while Ads.
      User clicks on flashplayer progress bar are now detected for the detection of the end of the song.
      New Buttons.
      Changelog 1.0.6.2
      Adapted to new AutoIt Version and Youtube changes.
      Hope you like it ! 
      Previous downloads : 500

      source : TinyChartsJukebox v1.0.6.2.au3.html
      executable :  TinyChartsJukebox.exe.html
      (Once the html file is downloaded, double click on it for start the download)
×
×
  • Create New...