Project

olap-view

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby On Rails gem to visualize by Google Charts MDX queries on OLAP databases using XMLA connection. Can be used with any XMLA-compliant server, like Olaper or Mondrian.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

>= 0.0.10, ~> 0.0
 Project Readme

Olap::View

Ruby On Rails gem to visualize by Google Charts MDX queries on OLAP databases using XMLA connection. Can be used with any XMLA-compliant server, like Olaper or Mondrian.

Installation

Add this line to your application's Gemfile:

gem 'olap-view'

And then execute:

$ bundle

Or install it yourself as:

$ gem install olap-view

Usage

Include required files in the application

Include Olap::View helper to application_helper.rb

include OlapViewHelper

Import olap-view Sass file (for example, application.scss) to get all of olap-view style:

@import "olap-view/olap-view";

Add Google Charts initialize into <head> tag in your laoyut (for examlpe, application.html.erb):

<head>
...
<%= olap_view_charts_init %>
</head>

Configuration in Rails

Querying MDX

This gem use olap-xmla ( https://github.com/Wondersoft/olap-xmla ) and does not parse MDX, just passes it to XMLA server. However, it can do substituting parameters in the query:

MDX_QUERY = 'SET [~ROWS_Date] AS {[DateTime].[Date].[Date].[%DATE%]}'

Olap::View.request MDX_QUERY, {'%DATE%' => '20150530'}

Render Google Chart by MDX

At the moment only available :table, :piechart, :barchart and partially :combochart charts.

Insert helper menthod to erb file:

<%= olap_view_chart_by_mdx :table, 
    'SET [~ROWS_Date] AS {[DateTime].[Date].[Date].[%DATE%]}', 
    {'%DATE%' => '20150530'} %>

Use one MDX to many Charts

<% xmla = Olap::View.request 'SET [~ROWS_Date] AS {[DateTime].[Date].[Date].[%DATE%]}', 
    {'%DATE%' => '20150530'} %>
<div>
  <h1>PieChart</h1> 
  <%= olap_view_chart_by_xmla :piechart, xmla %>
</div>
<div>
  <h1>Table</h1>
  <%= olap_view_chart_by_xmla :table, xmla %>
</div>

Available parameters

In olap_view_chart_by_mdx and olap_view_chart_by_xmla following properties are available:

  <%= olap_view_chart_by_xmla :table, xmla, properties %> 

total: true show total string in table chart

rowspan: true unites the cells with the same data from the dimenssions in table chart

function: "text on JS" execute ani js code into chart template

dimension: "Source Name" aggregate xmla data by dimesion

merge_dimensions: true merge dimensions to one table

measures: "[Measures].[Click]" show only selected measure from xmla data and sort by order

options: {} Google Charts draw options

Contributing

  1. Fork it ( https://github.com/Wondersoft/olap-view/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request