Page 1 of 1

Draw graphics

Posted: Sat Mar 23, 2013 4:47 am
by Eonsv
If I were to create a new panel and draw shapes like lines, circles and text in this panel. How would I go about scripting this? I've tried searching google, and this forum (and the wiki) for how to do this, but without luck. Thanks in advance for all helpful answers!

Drawing simple graphics in a panel

Posted: Sun Mar 24, 2013 6:32 pm
by Eonsv
Hello,
I'm making an addon which visualizes some statistics of the current playlist. I Therefore need to draw some graphics in a panel, but I haven't found a way to do this. (I haven't found any information of how to draw graphics with VBScript on the wiki, or with a google search) The statistics I want to visualize are simple things. Things like a chart for how many songs are in each genre, a graph for how the BPM vary with each song (BPM as function of the song's index) etc. Therefore just simple lines and dots (And possibly small circles) are needed, as well as some colouring. I would be very greatful if anyone could point me in the right direction for how to do this.

Re: Drawing simple graphics in a panel

Posted: Sun Mar 24, 2013 7:55 pm
by rovingcowboy
what your asking is how to make graphs with code and have it show in a window in different color progress bars, that is way intense for programming members here other then maybe the mm developing team and they are busy with making and fixing their mm program
I suggest searching on google where you can find out how to program there for free just by looking for the correct help.

Try using search for drawing with algorithms.
Maybe that will help you.

Re: Drawing simple graphics in a panel

Posted: Mon Mar 25, 2013 7:36 am
by trixmoto
I think within MM the only way probably to do this is with an IE OCX that uses HTML5 and the canvas tag. This would only work if the user has IE9+ installed, but it should give you all the functionality you require.

Or there are graphing tools, such as Google Charts, where you can pass data in and it returns an image that you can then display on the panel - this might make it a lot simplar, as Google is handling all of the drawing, but of course this only works if they provide the functionality that you need.

Re: Drawing simple graphics in a panel

Posted: Sat Mar 30, 2013 11:13 pm
by Eonsv
Thanks for pointing me towards those charts APIs. Google charts is not an option, as it requires the user to be online. However I found another one(flot) which works offline. It works perfectly, but I've no idea how to pass data into it. My first choice was to make a file using the MM app (written in vbscript), which then the javascript html page with the graph would read. But it seems like javascript can't read local files. Do anyone have any ideas to how I can manage to transfer the data from the vbscript app to the javascript html page? (I'm sorry if this is a silly question, as I'm a bit noobish when it comes to this kind of programming. And the Wiki doesn't seem to have an extensive documentation for how the ActiveX object works.)
Thanks in advance! :)