d3.js

Change color of marker-end on mouseover

自闭症网瘾萝莉.ら 提交于 2020-01-07 03:04:35
问题 I want to select a marker to change the color of it while mouseover is on a particular arrow head. On mouseover I want all the other nodes and arrows to fade down. I tried to use d3.selectAll("#arrowhead").style("fill","#BFC3E1"); , but it didn't work. My code is here http://plnkr.co/edit/EvpNC6B5DBWczNXKiL82?p=preview 回答1: You can't change the color of the same marker individually to correspond to the color of the line dynamically. The only way to do it is to create separate markers and give

DC.JS get last month value as filter

旧城冷巷雨未停 提交于 2020-01-07 02:51:25
问题 I've got a question concerning measures that can't be aggregated over time, for example stock value. In the example below, I've created a time line for my total stock value, which works well. Additionally I would like to see the most current stock level per company. This should be last month of my time selection. I can't get this to work as the stock value is being summed over the entire period, where I would like to see the stock value of the last period (month). Whenever I change my

DC.JS get last month value as filter

↘锁芯ラ 提交于 2020-01-07 02:51:10
问题 I've got a question concerning measures that can't be aggregated over time, for example stock value. In the example below, I've created a time line for my total stock value, which works well. Additionally I would like to see the most current stock level per company. This should be last month of my time selection. I can't get this to work as the stock value is being summed over the entire period, where I would like to see the stock value of the last period (month). Whenever I change my

d3 tooltip | passing in a variable

烈酒焚心 提交于 2020-01-07 02:47:08
问题 I have a webpage with 4 d3 charts for each of 11 different regions. One of those charts is an area chart and the code snippet is: for (mm=0; mm<regions.length; mm++) { areas.append("path") .attr("class",function(d,i){ return "area cons ar"+i+" region"+mm;} ) .attr("id", function(d,i) { return "area_"+i+"_"+mm}) .attr("d", function(d,i) { return area(d)} ); var test = d3.selectAll("path.region"+mm) .call(d3.helper.tooltip() .attr("class", function(d, i) { return "tooltip"; }) .text(function(d,

Reshape data for D3 stacked bar chart

坚强是说给别人听的谎言 提交于 2020-01-07 02:23:15
问题 I have some csv data of the following format, that I have loaded with d3.csv() : Name, Group, Amount Bill, A, 25 Bill, B, 35 Bill, C, 45 Joe, A, 5 Joe, B, 8 But as I understand from various examples, I need the data like this to use it in a stacked bar chart: Name, AmountA, AmountB, AmountC Bill, 25, 35, 45 Joe, 5, 8, NA How can I transform my data appropriately in the js script? There is also the issue of missing data, as you can see in my example. Thanks for any help. 回答1: Yes, you are

Accessing nested data in D3

℡╲_俬逩灬. 提交于 2020-01-07 01:51:13
问题 I'm having trouble understanding when and how to use nested data. In this example I have a CSV with names ('Name') and locations ('starting point'). By assigning keys to the locations I am able to make a dropdown containing them all, and I would like to use this to filter the names associated with each location. However I am unable to find the data's values, in this case 'd.Name' Here inside the update function I have tried to access the 'values' on the data join. var adventurer = canvas

Accessing nested data in D3

旧时模样 提交于 2020-01-07 01:50:07
问题 I'm having trouble understanding when and how to use nested data. In this example I have a CSV with names ('Name') and locations ('starting point'). By assigning keys to the locations I am able to make a dropdown containing them all, and I would like to use this to filter the names associated with each location. However I am unable to find the data's values, in this case 'd.Name' Here inside the update function I have tried to access the 'values' on the data join. var adventurer = canvas

d3 clipPath - why is it cutting top of charts off? [duplicate]

痴心易碎 提交于 2020-01-06 19:55:48
问题 This question already has an answer here : clip-path and translate in “g” tag svg (1 answer) Closed 3 years ago . I have a graphic with three line graphs on it. I've added a single clipPath to the chart, covering all three line graphs. But the top of each line chart is being chopped off. I've added .nice() to the y axes, based on other SO answers, which has helped but not fixed the problem. When you zoom in with the time widget, the effect is very obvious: at the highest point of the line,

d3js zoom + drag causes conflict

試著忘記壹切 提交于 2020-01-06 18:42:27
问题 I am trying to apply the zoom behaviour to a svg where certain elements in the svg are already bound with drag behaviour. without the zoom behaviour drag works fine, without the drag behaviour zoom works fine. When I have both of them it conflicts. When I drag a circle all the other circles starts to drag with it. Here is the fiddle. can anyone help me to figure out the issue? <svg height="600" width="600" style="background: black"> <g> <rect x="0" y="0" , width="600" height="40" style="fill

d3js zoom + drag causes conflict

青春壹個敷衍的年華 提交于 2020-01-06 18:41:26
问题 I am trying to apply the zoom behaviour to a svg where certain elements in the svg are already bound with drag behaviour. without the zoom behaviour drag works fine, without the drag behaviour zoom works fine. When I have both of them it conflicts. When I drag a circle all the other circles starts to drag with it. Here is the fiddle. can anyone help me to figure out the issue? <svg height="600" width="600" style="background: black"> <g> <rect x="0" y="0" , width="600" height="40" style="fill