I have two tables, one that shows the sales history of salespeople per year, and another table that shows the sales history in months. As you can see in the image below:
I need to create a composite chart (I believe it is a composite chart, as it will have more than 01 line) that is exactly the representation of the month table.
After creating the chart when I click on the seller Miguel for example, the chart will be rendered with the history of that seller.
And for example if I click on month 03 of the graph, the table of sellers will be rendered only with the sales that were made in month 03.
I don't know how to do it, I managed to create a composite chart that presents the same data as the month table, however, I was unable to integrate my chart together with my tables.
Can you tell me how I can do that?
I put the codes I made in JSFiddle, here are the links:
Sales/Month Table: https://jsfiddle.net/bernalvinicius/ejxcfpvz/15/
Month Chart: https://jsfiddle.net/bernalvinicius/kanm158j/17/
Thanks in advance.
Just put all your code in the same file(s), combine your crossfilter instances, and put all the charts in the same chart group (the default), and it should work fine.
The chart group is the second parameter to each chart constructor. If it's not specified, then the chart goes into the default chart group.
When any chart is filtered in a chart group, it will tell all the other charts in that chart group to redraw, and they will pull their new data from their respective crossfilter groups. (Sorry about the naming, a dc.js chart group has nothing to do with a crossfilter group.)
In order to combine your code, I renamed both of the crossfilter instances to cf. Then I added the new fields you are generating to the existing rows, instead of mapping the data:
data.forEach(d =>
Object.assign(d, {
mes: d.Month,
atual: d.Vendas_Ano,
passado: d.Vendas_Ant
})
);
In your table fiddle, you were initializing the table for every row in the data with a data.forEach() which wasn't necessary. That's why it was so slow to load.
Other than that, both fiddles had the same general structure so I just copied and pasted the code from the table fiddle to the composite fiddle, HTML, JS, and CSS.
In the JS I made sure to put the same lines outside and inside the d3.json() callback as before.
It looks like it works?
https://jsfiddle.net/gordonwoodhull/0q1y5ftr/15/
Related
I have a multi page report with Page 1 having a Table chart with filter interactions ON. When I click on a row in this Table chart, I need my other pages also to get filtered based on this row selection.
If I make this table chart report-level, then this table chart will be visible in other pages which I do not want. What is the best possible way to solve this problem?
An alternative approach is to use a Filter Control (set to Report-level) instead of a Table; additionally, a default selection could be set.
Google Data Studio Report and a GIF to elaborate:
As a first time OBIEE user, I've built an analysis containing a pie chart and added it to a dashboard. I want to be able to click on a slice of the pie chart and it should open a new page or analysis. I tried using Action Links but that seems to be working only for the column heading of a table but not for table contents or in my case the pie charts. Is this a possibility in OBIEE 12c?
Yes. Action links will work on the value too. Check out the documentation and the embedded video: https://docs.oracle.com/middleware/12213/biee/BIEUG/GUID-63576665-7BFE-4D1E-ABB9-51B8AAFBB940.htm#GUID-63576665-7BFE-4D1E-ABB9-51B8AAFBB940
So for a while I had struggled with how to filter a dataTable in dc.js without affecting other dimensions. This seems counter-intuitive, as it goes against what crossfilter(the data filter behind dc.js) does best, but I'll explain why this can be relevant.
Suppose I have a dataset of peoples name age and gender. In one of my datatables, I only want to display males; using one crossfilter, I would be forced to filter all my other datatables by males.
Suppose I also have a pie chart that lists the first letter of each person's name, and I want to be able to filter on the 'M's. I have a table for males, and a table for females. I don't want these tables to affect the distribution of the pie chart, but I want to be able to click on the pie chart and have it filter the dc.js datatables. More or a less a one way filter.
What is the way to achieve this?
dc.js datatables accept crossfilter dimensions. I got around the problem by extending the dimension as follows.
function preFilter(dim,okey,oval){
return{
top:function(x){
var a1 = dim.top(x).filter(function(v){
return v[okey] === oval;
});
return a1;
}
};
}
This worked well for me, I hope it can help others.
A,100
B,120
C,50
D,20
Plotting this in a Chart produces the correct result: it gives me a chart with 4 columns.
What i want however is to add all these values into one column and have the chart show only one as i will be adding more data series (via lookUp) that will show additional related data.
Can this be achieved?
You can modify the dataset of the report, by summing A,B,C and D instead of selecting each one on it's own.
Try changing the chart type to a stacked column chart
I need to change the orientation of a table in a BIRT report so that the table header is vertical instead of horizontal.
Is this possible? I don't want to use a Crosstab.
It seems this thread is still being pointed at so I posted an example of a horizontal table layout using a crosstab. I know it won't help the original author but others following this thread now may find this helpful.
To create the horizontal grouping, first create your query like normal, then create a Data Cube. In this data cube, drag each field that you want into a group. Then drag a new crosstab on the report and drag each field into the top right column group area. It will create a new header row for each field. Don't put anything in the left side (Rows) and don't put anything in the measure field (bottom-right). This will create labels on the left... and the data will extend out to the right.
The report design example can be downloaded from: http://developer.actuate.com/community/forum/index.php?/files/file/1079-horizontal-table-using-crosstab/
Virgil
If you want dataset records to be reported across the page, this would have to be done via a crosstab.
If you want dataset records to be reported down the page, this can't be done automatically as far as I know. However, it can be done by inserting a new detail line in your report table object for each database field to be reported, then moving column headings from the heading row into the first column's detail rows and moving record values into the second column's detail rows.
So, for example, a report with 6 columns in it would become a two column report with six detail rows.
Not in box (up to 3.7). You have to use 3'd party libs like that one.