Index: /quintagroup.analytics/branches/update_mt/quintagroup/analytics/browser/configure.zcml
===================================================================
--- /quintagroup.analytics/branches/update_mt/quintagroup/analytics/browser/configure.zcml	(revision 3350)
+++ /quintagroup.analytics/branches/update_mt/quintagroup/analytics/browser/configure.zcml	(revision 3351)
@@ -70,6 +70,6 @@
         for="*"
         permission="zope2.ViewManagementScreens"
-        attribute="getSizeInfoByPath"
         class=".views.SizeByPath"
+        template="objects_size_stat.pt"
         />
 
Index: /quintagroup.analytics/branches/update_mt/quintagroup/analytics/browser/objects_size_stat.pt
===================================================================
--- /quintagroup.analytics/branches/update_mt/quintagroup/analytics/browser/objects_size_stat.pt	(revision 3351)
+++ /quintagroup.analytics/branches/update_mt/quintagroup/analytics/browser/objects_size_stat.pt	(revision 3351)
@@ -0,0 +1,61 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+      xmlns:tal="http://xml.zope.org/namespaces/tal"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+      lang="en"
+      metal:use-macro="context/prefs_main_template/macros/master">
+
+<metal:main metal:fill-slot="prefs_configlet_main"
+            i18n:domain="quintagroup.analytics"
+            tal:define="type_name request/type_name;
+                        data python:view.get_data(type_name)">
+
+   <body>
+       <div id="wrapper">
+           <h1>Quintagroup Analytics Tool for Plone</h1>
+           <ul class="formTabs" id="navigation">
+               <li class="formTab"><a href="@@qa_overview">Overview</a></li>
+               <li class="formTab"><a href="@@ownership_by_type">Ownership by type</a></li>
+               <li class="formTab"><a href="@@ownership_by_state">Ownership by state</a></li>
+               <li class="formTab"><a href="@@type_by_state">Types by state</a></li>
+               <li class="formTab"><a href="@@portlets_stats">Portlets stats</a></li>
+               <li class="formTab"><a href="@@legacy_portlets">Legacy portlets</a></li>
+               <li class="formTab"><a href="@@properties_stats">Properties stats</a></li>
+               <li class="formTab"><a class="selected" href="@@size_stats_path">Objects by size</a></li>
+           </ul>
+           <p>The following chart displays the objects size by choosen type. 
+            <form  action="@@size_stats_path" 
+                   method="post">
+                     Objects type (you can type 'all' to see all types):
+                     <br /> 
+                    <input type="input" id="type_name" name="type_name" 
+                           tal:attributes="value type_name"  />
+                    <input type="submit" 
+                           class="standalone" 
+                           value="View stats">
+            </form>
+            </p>
+       </div>
+       <div id="chart" tal:content="structure view/getChart">
+           Chart will be here
+       </div> 
+
+       <table tal:condition="data" class="listing">
+          <thead>
+               <tr>
+                  <th>ID</th>
+                  <th>Size</th>
+               </tr>
+           </thead>
+           <tbody> 
+              <tal:block  tal:repeat="file data">
+                    <tr tal:attributes="class python:repeat['file'].odd() and 'even' or 'odd'">
+                        <td><a tal:content="file/id" tal:attributes="href file/path">id</a></td>
+                        <td tal:content="file/h_size">123</td>                        
+                    </tr>
+              </tal:block>
+           </tbody>
+       </table>
+   </body>
+</metal:main>
+</html>
Index: /quintagroup.analytics/branches/update_mt/quintagroup/analytics/browser/views.py
===================================================================
--- /quintagroup.analytics/branches/update_mt/quintagroup/analytics/browser/views.py	(revision 3350)
+++ /quintagroup.analytics/branches/update_mt/quintagroup/analytics/browser/views.py	(revision 3351)
@@ -1,3 +1,4 @@
 from pprint import pprint
+from operator import itemgetter
 from Acquisition import aq_base
 from zope.component import getUtility, getMultiAdapter, queryMultiAdapter
@@ -11,4 +12,6 @@
 from plone.portlets.interfaces import IPortletAssignmentMapping
 from plone.portlets.interfaces import ILocalPortletAssignmentManager
+
+from plone.memoize import view
 
 try:
@@ -536,5 +539,5 @@
         num /= 1024.0
     # add more suffixes if you need them
-    return '%.2f %sB' % (num, ['', 'K', 'M', 'G', 'T', 'P'][magnitude])
+    return '%.0f %sB' % (num, ['', 'K', 'M', 'G', 'T', 'P'][magnitude])
 
 def getSize(brain):
@@ -544,4 +547,7 @@
                  or 1)
 
+def matrix_tranform(a):
+    b = [0 for i in range(len(a)-1)]
+    return [b[:i]+[a[i]]+b[i:] for i in range(len(a))]
 
 class SizeByPath(BrowserView):
@@ -555,5 +561,7 @@
         bpath = self.request.form.get('basepath')
         self.basepath = bpath and "/"+bpath.strip("/") or ""
-
+        # set default value for type by size stats
+        if not hasattr(self.request, 'type_name'):
+            self.request['type_name'] = "File"
 
     def _brainsByPath(self, path):
@@ -614,2 +622,33 @@
         
         return infos
+
+    @view.memoize
+    def get_data(self, serh_type="File"):
+        if serh_type != "all":
+            objects_by_types_info = [i for i in self.getSizeInfoByPath() if i['type']==serh_type]
+        else:
+            objects_by_types_info = self.getSizeInfoByPath()
+        return sorted([ {'h_size': human_format(i['size']), 
+                          'size' : i['size'],
+                          'path' : i['path'],
+                          'id'   : i['path'].split('/')[-1]} 
+                        for i in objects_by_types_info ],
+                      key=itemgetter('size'),
+                      reverse=True)
+
+    def getChart(self):
+        type_name = self.request['type_name']
+        info_obj = self.get_data(type_name)[:10]
+        if not info_obj:
+            return "<h2>Not found objetcs of '%s' type</h2>" % type_name
+        path, data = zip(*map(itemgetter('path','size'), info_obj))
+        max_value = data[0]
+        #We need transpozed dataset, matrix_tranform does trabspozition
+        chart = VerticalBarStack(matrix_tranform(data))
+        chart.title('Objects of "%s" type by size'%type_name)
+        chart.bar('a', 10, 0).legend_pos("b")#.legend(*path)
+        chart.color(*COLORS)
+        chart.size(800, 375).scale(0,max_value)
+        chart.axes('xy').axes.type("y").axes.range(0,0,max_value)
+        return chart.img()
+        
