fake group and filtering dc.js - dc.js

I have had to create a cumulative sum group and a remove_zero group for my project.
The issue arises when I combine them and filters on another dimension. It looks like the filter is not taken into account in my cumulative sum fake group.
I have put everything into this jsFiddle.
When filtering on age by clicking on the barchart on top (only the 1w will do something), both line charts at the bottom should have the same date span if I understand correctly since they're using the same dimension. But that does not happen. The top one does not rescale at all while the bottom one does.
The only difference between the 2 line graphs (that I can see) is in the group definition :
top one :.group(remove_zero_values(cumulSumGroup(groups.date.TOTAL_PNL)))
bottom one :.group(remove_zero_values(groups.date.TOTAL_DELTA))
My question is : how do I make sure that the top line graph also filters on dates when I click on the top bar chart ?

If you are combining cumulative sum with filtering zeros, you will want to filter the zeros first:
.group(cumulSumGroup(remove_zero_values(groups.date.TOTAL_PNL)))
Otherwise, each bin will inherit a value from the last one, and very few of them will remain zero.
Fork of your fiddle.

Related

Barplot with frequency by specific factor

I would like to create a barplot in TIBCO Spotfire with frequency on Y axis based on two factors: Stage and Genotype.
This is the standard expression that I have from Spotfire:
Count() THEN [Value] / Sum([Value]) OVER (All([Axis.X]))
It turns out, I do not want the frequency over ALL the data, but within Stage. In a way that the sum of the frequency within each is stage it will be 100%.
I watched some videos and I still did not figured out.
I tried to find a solution to your problem but could't find a working expression. This can still help you :
What I would have done in your case is :
remove the Genotype from the X Axis
set the visualization as a 100% stacked bars (with right click)
add the Genotype as a color by parameter (in the visualization options)

Tableau Remove extra space within sheet border

I am creating sheet with rows of Sale Sums and Columns of each month. Firstly, I am trying to remove this extra whitespace within the boundaries while keeping the squares the same size. I would like the squares of data to take up the entirety of the region. Also, I have tried creating lines to separate each row but adding grid lines creates lines going through the squares.
go to format > borders
select none in columns
select none in rows

Position tablix elements at the same position on different pages in SSRS

I have multiple tablixes that are rendered individually on each Excel worksheet when exported. However, I need the position of the tablixes to remain the same throughout all the different sheets, because currently, from the second sheet onwards, the tablix is not in the same position as the first one.
Please help!
What I have done in the past:
You should create the tablix objects with a fixed height and width for better use of assignment.
You should be altering it more on the 'Properties' pane than trying to use the mouse for fixed positions to be more precise. Set the 'tablix' object of my first one and select 'Size' to be 3in, 0.75in for 3 inch width and 0.75 in height.
I would set the 'Location' for the first to 0in,0in. Then using a similar method as 2 for setting a fixed size, start you next one at 0in,(height of first)in. So in my case it would be 0in,0.75in for the next one.
Set the 'PageBreak' > 'BreakLocation' to be 'End' for the first one and every other object you need to break onto a new page. You should NOT do this for the last object as you could generate a blank final page potentially.
Optional:
You can name the pages as well that appear under 'PageName' as this names the sheet in Excel as well.
Treat your report template as a Cartesian plane, with origin on top left corner with positive y-axis in the "down" direction. Ensure that your charts/graphs/tables are of the same dimension and placed at equidistant points within your plane. E.g. If you have two charts both 2 inches by 2 inches and your report template is 4 inches by 4 inches, then your first chart will be at (0,0) and your 2nd will be at (0,2). Keep this in mind and you will not falter, god-speed!

Increasing width and spacing of major groups in a d3 nested group graph

I was able to create a chart using sub groups in the manner described here. The results look like this:
I'd like to be able to control width of the colored bars as the number of categories within them increases, rather than just have the category width decrease in width to fit a constant major group width. As a result of this, as the data increases, I'd like to have the "excess" graph just go off the div, like so:
and the excess would be access by means of scrolling, I guess with .css .scroll property.
How does one achieve this kind of look?

Mac Excel 2011 - Histogram with normal distribution

Let's say I have a list of values and I have already chunked them into groups to make a histogram.
Since Excel doesn't have histograms, I made a bar plot using the groups I developed. Specifically, I have the frequencies 2 6 12 10 2 and it produces the bar plot you see below.
Next, I want to add a normal distribution (line plot) with a mean of 0.136 and standard deviation of 0.497 on top of this histogram. How can I do this in excel? I need the axis to line up such that it takes up the width of the bar plot. Otherwise, you get something like I've attached.
But...the normal should be overlayed on the bar plot. How can I get this effect?
There are two main part to this answer:
First, I reverse-engineered the grouped data to come up with an appropriate mean and standard deviation on this scale.
Second, I employed some chart trickery to make the normal distribution curve look right when superimposed on the column chart. I used Excel 2007 for this; hopefully you have the same options available in your version.
Part 1: Reverse-Engineer
The column B formulae are:
Last Point =MAX(A2:A6)
Mean =SUMPRODUCT(B2:B6,A2:A6)/SUM(B2:B6)
E(x^2f) =SUMPRODUCT(A2:A6^2,B2:B6)
E(xf)^2 =SUMPRODUCT(A2:A6,B2:B6)^2
E(f) =SUM(B2:B6)
Variance =B10-B11/B12
StDev =SQRT(B13/(B12-1))
Part 2: Chart Trickery
Data table:
Column D is just an incremental counter. This will be the number of data points in the normal distribution curve.
E2 =D2/$B$8 etc.
F2 =NORMDIST(E2,$B$9,$B$14,FALSE) etc.
Chart:
Now, add Columns E:F to the chart. You will need to massage a few things:
Change the series to be an X-Y plot. This might require some editing of the chart series to force a single series to use your desired X and Y values.
Change the series to use the secondary axes (both X and Y).
Change the secondary X-axis range to 0.5-5.5 (i.e., 0.5 on either side of the column chart category values). This will effectively align the primary and secondary X-axes.
Change the secondary Y-axis range to 0-1
Format the X-Y series appearance to taste (I suggest removing value markers).
The result so far:
Lastly, you can remove the tick marks and labels on the secondary axes to clean up the look.
Postscript: Thanks to John Peltier for innumerable charting inspirations over the years.

Resources