grab Key values from PieChart selections - dc.js

I would like to grab the key value/s from selected PieChart slices so I can use them elsewhere on my page. Just as a basic text list of the selections made from the PieChart, I don't need the corresponding value.
I think that I need to use a Listener on the PieChart and keyAccessor but I'm not sure how to go about it.
Can anyone help or point me at an example?

You're looking for the 'filtered' event:
chart.on('filtered.my_event', function (chart) {
// chart.filters() contains the current selection
console.log(chart.filters());
});
.filters() returns an array of keys, should not need to processed further.

Related

Kendo grid How can I display row content on mouse over for each column as my data is huge?

I need to display open a pane where I can display the full text of selected column.
I was referring to
How can I add multiple tooltips on kendo ui grid.
but not getting how to get the tooltip for each column selected.
Thanks in advance.
See if this demo helps you.
The Tooltip widget has a content configuration that accepts either a string or a function returning a string.
This function gets a parameter containing the target for the tooltip which is the element your mouse is hovering over.
You can filter the elements so that only tds pop the tooltip.
Here's how I built and applied the tooltip options object I use in the example:
$("#container").kendoTooltip({
filter: "td",
content: function(e) {return e.target.html();}
});
This example will show a tooltip containing the same content as the cell you're poining at.
If you have any further questions, feel free to ask them.

kendo treeList- change color of child rows depending on certain condition

In kendo tree list, how to change the color of entire child row depending on certain data value?
I tried the method mentioned here: How to change color of row depending on a row's value in a Kendo UI Grid
it does not work, any other solution?
Thanks in advance.
You can iterate through rows in dataBound event and set classes or whatever you want there.
Example

Column header shows arrow icon after sortable is false in ExtJs grid

I have an ExtJs GridPanel in which sortable is false in all the columns.
Then if I sort store by
this.store.sort('Column1','ASC');
then the arrow reappers .
Does sortable gets true?
Is this because I am sorting the store or anything else?
If it the reason different than that then what is the solution for removing the arrow?
I would appreciate any help on this.
The arrow is being shown because of the sorter in the store, which identifies a column in the grid which has the dataIndex equal to the property you are sorting, despite the sorting being disable on this column. In this case, you could override the getSortParam function in your column definition, like this:
getSortParam: Ext.emptyFn
And your column will no longer show the arrow in the header.

D3.js: concatenate selections?

Is there a way in D3 to concatenate selections?
Use case: I'd like to add a mouseover event to both the update and enter selections of a particular selection.
I can do this as follows:
var s = d3.selectAll('.yellow').data(myData);
s.on('mouseover'...
s.enter().append('path').attr('class','yellow').on('mouseover'...
But I'd prefer to do it with one line of code.
In this particular case you don't need to concatenate -- the enter selection merges into the update selection after it's been called, so all you need to do is handle .enter() before the update selection.
In general, you can't really concatenate selections as such, but in practice this isn't really necessary. You can either modify the selection condition to select all the elements you need, or, if this is not possible, use .call() to run a function on all selected elements. This way you don't need to repeat the code to set attributes etc.

Crossfilter filter based on textbox

I would like to filter my data based on the input in a textbox. Is this possible? Something like this but with crossfilter.
Certainly possible with crossfilter, just create dimension objects from your raw data and then apply a filter by the input of the text box.
myDimension.filter(valueFromBox); // selects values who equal the value in the text box
Check out the API docs here.

Resources