Twitter/Facebook

Pinterest
Friday, October 10, 2014

Hello Everyone: Today, we will see how we can create a bar graph like structure with straight table using images instead of conventional bars. 

Download here-->QVW
Let's take an example (Filmography)
Script: 
Below are the three parts of the script:


Part 1:
im loading it with an inserted field: Path of my image as F2 as highlighted below.


Part2
In count table I aggregate the count(Film) to languages. 

In max table I pick the max(NoFilms) and assign its value to vmax variable. In out example max number of films in a particular language is 134. 

I do the same to get the min number of films in a language which happens to be 8.

vmax=134
vmin=8
vscale=floor(vmax/vmin)=floor(16.75)=16



Part 3:
I create a table named Number with one field number. 
The value of the number needs to hold the x axis values. 

 ceil(vmax/vscale)=ceil(134/16)=9

for i=1 to 9 
i*vscale as number
next
This for loop will load multiples of vscale(16) till 9th multiple (144)





Designing the chart
number filed will have the above values. 
create a pivot table with following dimension and measure


Expression:
=if(Count(Film)>number,'qmem:///BuiltIn/arrow_w_y.png')

This will fill the image in the field only if the count(Film) for a language is greater than number in the dimension. Which means the image will be filled till it's value in the scale.

=if(Count(Film)>number,F2) in case we need out image to be shown instead of the inbuilt image.

Change the representation to image and formatting to keep aspect as below.


Change the cell border properties as below


We get a graph like below.



0 Scribbles:

Post a Comment

Thank You for taking pains, commenting :)

LinkWithin

Search This Blog

 
badge