Mar 24, 2015

Center Align Microstrategy Dashboard

There are many times when you want your MSTR dashboard to be center aligned, but its not. If your dashboard is viewed in Interactive mode then there is a simple trick to achieve same. This can be done by adding simple javascript code in a html container.  You may find same approach on other blogs, but they use jQuery. WHile you use jQuery, you need to load jQuery lbrary files which some times is a problem. Hence, I decided to write the same using only javascript.

Steps:


1. Add an HTML container in your dashboard and paste the below code into it.

<script>
document.addEventListener("DOMContentLoaded",init);
document.addEventListener("resize", init);

function init() {
var dbWidth= Number(1200);
var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],
x=w.innerWidth||e.clientWidth||g.clientWidth,
y=w.innerHeight||e.clientHeight||g.clientHeight;
elem = document.getElementById("rwb_viewer");
var leftMargin=(x-dbWidth)/2;
elem.style.left = leftMargin+'px';
}
</script>

2. Replace the dbWidth value with your dashboard width (in this example its 1200)
3. Make the color of HTML container as your background color or place it behind some component to hide it.
4. Save the dashboard and run it in Interactive mode.




4 comments:

  1. Vital Statistics is a premium dashboard specifically designed for businesses using MYOB Exo Business Dashboard. Vital Statistics seamlessly integrates Business Intelligence,Intelligence Dashboards,Data Analytics.

    Business Intelligence Dashboard

    ReplyDelete
  2. Thanks for the post, very useful. Would like to suggest best training on Microstrategy visit
    MicroStrategy Online Training USA

    ReplyDelete
  3. Very informative ..i suggest this blog to my friends..Thank you for sharing
    MicroStrategy Online Training bangalore

    ReplyDelete