Assets

Page 1 of 1
4 posts
Assets

Nikolay
MMEX Developer

Posts: 2284
Joined: Sat Dec 06, 2008 8:27 am
Location: Sankt-Petersburg, Russia
New GRM will be described on wiki
https://sourceforge.net/p/moneymanagere ... 20Manager/

assetsGRM.gif
(241.38 KiB) Downloaded 541 times
Re: Assets

Nikolay
MMEX Developer

Posts: 2284
Joined: Sat Dec 06, 2008 8:27 am
Location: Sankt-Petersburg, Russia
More advances js
https://github.com/Regaddi/Chart.js/tree/tooltips

assets_gt.png
(24.3 KiB) Downloaded 520 times


SQL
Code: Select all
SELECT
'' as COLOR,
assettype,
total(value) as VALUE
FROM ASSETS_V1
group by assettype
order by value desc;


Lua script:
Code: Select all
local total = 1;
local count = 0;
local data = "";
local colors = {"#FBD4B4", "#E5B8B7", "#B6DDE8", "#B8CCE4", "#F0EDCE", "#DEE3E7", "#99FF99"};

function handle_record(record)
   total = total + record:get('VALUE');
    count = count +1;
    data = data .. '{value: ' .. record:get('VALUE') .. ', color:"' .. colors[count] .. '", label : "' .. record:get('ASSETTYPE') ..'", labelColor : "black", labelFontSize : "12", labelAlign : "center"},\n';
    record:set('COLOR', colors[count]);
end

function complete(result)
   result:set('ASSET_TOTAL', total);
   result:set('ASSET_DATA', data);
end


Template:
Code: Select all
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>MoneyManagerEx - Report</title>
    <SCRIPT><TMPL_INCLUDE NAME="Chart.js"></SCRIPT>
</head>
<h3><TMPL_VAR REPORTNAME></h3>
<TMPL_VAR TODAY><hr>
<table cellspacing='1' width='90%'>
<tr><td><table cellspacing='1' >

<tr><td><canvas id="reportChart" width="300" height="300"></canvas></td></tr>

    <tr bgcolor='#4f81bd'>
        <th ><font color="white">ASSETTYPE</font></th>
        <th><font color="white">VALUE</font></th>
    </tr>
    <TMPL_LOOP NAME=CONTENTS>
        <tr bgcolor='<TMPL_VAR "COLOR">'>
        <td><TMPL_VAR "ASSETTYPE"></td>
        <td nowrap align='right'><TMPL_VAR "VALUE"></td>
        </tr>
    </TMPL_LOOP>
    <tr><td colspan=2><table border='1' width='100%'></table></td></tr>
        <tr>
        <td>Total:</td>
        <td nowrap align='right'><TMPL_VAR "ASSET_TOTAL"></td>
        </tr>
</td><td></td></tr></table></table>

<TMPL_LOOP ERRORS>
    <hr>
    <TMPL_VAR ERROR>
</TMPL_LOOP>

<script type="text/javascript">
      var data = [
<TMPL_VAR "ASSET_DATA">
];
      
      var options = {
      // animation : false,
      animationEasing: 'easeOutQuint'
      };
   
  // Get the context of the canvas element we want to select
  var ctx = document.getElementById("reportChart").getContext("2d");
  var reportChart = new Chart(ctx).Pie(data, options);
</script>
Re: Assets

Nikolay
MMEX Developer

Posts: 2284
Joined: Sat Dec 06, 2008 8:27 am
Location: Sankt-Petersburg, Russia
Report container


http://msdn.microsoft.com/en-us/library ... _emulation

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"mmex.exe"=dword:00002af9
Attachments
Asset_Totals.grm
(1.51 KiB) Downloaded 210 times
Re: Assets

Nikolay
MMEX Developer

Posts: 2284
Joined: Sat Dec 06, 2008 8:27 am
Location: Sankt-Petersburg, Russia
updated. only for svn >= 6145
Attachments
Asset_Totals.grm
(1.48 KiB) Downloaded 216 times
Page 1 of 1
Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 guests