d3.js

how to apply color to my axes in d3?

拟墨画扇 提交于 2019-12-25 04:15:30
问题 I am new to d3. I created an axes in d3 and its working fine but i can't set color to my axes. I tried fill:none but it doesn't work for me. Here is the jsfiddle link http://jsfiddle.net/untnht4u/ 回答1: You can color your axis with CSS. You can set class to the axis as shown below: var xAxisGroup = svgContainer.append("g") .attr("class", "axis") .call(xAxis); and on the css add class .axis path, .axis line { fill: none; stroke: red; shape-rendering: crispEdges; } working example here 来源: https

Problems when using the insert() function in d3 java library when trying to insert SVG elements before another

白昼怎懂夜的黑 提交于 2019-12-25 04:14:46
问题 I have problems using the insert() function of the d3 visualization library. Better to say I do not understand how to use the "before selector". I red the examples here and here, but this dod not help. I create an svg element and append an element to it. Then I append foreignObject-element to the group and would like afterward insert an rectangle before the foreignObject-element. Here is my code var body = d3.select("body"); var svg = body.append("svg") .attr("width", '100%') .attr("height",

Nodejs script fails to print after d3.json()?

≡放荡痞女 提交于 2019-12-25 04:08:08
问题 ( Edit: the question have been rewritten to better isolate the issue.) I'am writing a single D3js script.js which could be reused "as it" in both web browser for client side and nodejs for server side uses. I made some good progress : a single d3js script.js indeed create basic svg shapes on both client and server sides. On web browser displaying the viz, on server side outputing the wanted map.svg file. I have a more complex d3js map making code: client side it works like a charm (link) but!

d3 localStorage.getItem() compare arrays .filter()

烈酒焚心 提交于 2019-12-25 04:07:57
问题 I am trying to get values back from localStorage; multiple click counters in div elements. They were stored on click under key = this.id in localStorage; the values are the innerText of the divs. Now: 1. I filter the selection looking for a match for element-ids in arraylocal 2. if match, set the html. d3.selectAll(".numberCircle").filter((d) -> this.id in arraylocal).html(localStorage.getItem(((d) -> this.id)) I would like to get values ( innerText from elements ) back out of localStorage

dc.js - multiple lineChart based on separate categories in single csv file

99封情书 提交于 2019-12-25 04:07:11
问题 For example if I have the following csv file: category, number, total A,1,3 A,2,5 A,3,1 B,1,4 B,2,6 B,3,1 C,1,5 C,2,2 C,3,4 I was able to follow the following example and separate out the data into different csv files and composing each one. github link However, I was wondering how would I recreate the same lineCharts if I were to only have a single csv file and separate each lineChart by each grouped category. Thanks. 回答1: @minikomi's answer is the straight d3 way to do this. The dc.js

How to use CSV data in d3

可紊 提交于 2019-12-25 03:35:51
问题 What I want to do My CSV looks like this ,,Name,First names,s,r,Nat,born,starting point,starting date,arrival date,days,km,Assist,Support,Style,note,arrival date 2 1,1,KAGGE,Erling,,,Nor,1/15/1963,Berkner Island,11/18/1992,1/7/1993,50,appr. 1300,n,n,solo,first solo unassisted, 2,2,ARNESEN,Liv,f,,Nor,6/1/1953,Hercules Inlet,11/4/1994,12/24/1994,50,1130,n,n,solo,first woman unassisted, 3,3,HAUGE,Odd Harald,,,Nor,1956,Berkner Island,11/4/1994,12/27/1994,54,appr. 1300,n,n,,, How should I import

dc.js d3+crossfilter.top to export filtered data to CSV

徘徊边缘 提交于 2019-12-25 03:35:08
问题 I have looked extensively at code samples and have been able to call crossfilter's .top(Infinity) function to output the updated data records after filtration. I am even able to call d3.csv.format with .top(n) in order to get a string'ified CSV output that can be downloaded. But I have a couple issues. I am calling the top and csv.format functions in my chart draw method as explained here: d3.csv("/data/acuityData.csv", function (data) { // format our data var dtgFormat = d3.time.format("%Y-

How to force d3js to take hours into account when x axis is created?

百般思念 提交于 2019-12-25 03:34:29
问题 Fiddle : http://jsfiddle.net/8eba8q33/2/ I have my x axis which is a time scale var x = d3.time.scale().range([0, width]); On the x axis i want to be able to have exactly 10 ticks if i have 10 values in my json data. my json Array contains Objects like: CurrentQuantity: 20 LastUpdated: Thu Jan 15 2015 13:09:30 GMT+0100 (Romance Standard Time) when i want to create a domain for x axis i trying to do this: x.domain(d3.extent(data, function(d) { return d.LastUpdated; })); but for some reason

Slow performance in Firefox for D3 force layout

こ雲淡風輕ζ 提交于 2019-12-25 03:32:45
问题 I've created a force-layout using D3 (see image below). However, it runs very slowly in Firefox, whereas it works perfectly fine in Chrome. I'm debugging it using a local server and browsing at http://localhost:8888/. It's might be due to the following message in the Firefox console, but accordingly to the comments that's unlikely. Can someone pinpoint the performance issue and give me a hint on how to resolve it? mutating the [[Prototype]] of an object will cause your code to run very slowly

NVD3 noData text color change

混江龙づ霸主 提交于 2019-12-25 03:04:11
问题 I am using nvd3 line chart and customize the text of noData. Now i need to update the color of the text and want text underline. I have updated the css with below changes. text.nvd3.nv-noData{ color:"yellow"; text-decoration: underline; } however, text-decoration works perfectly but color is not getting change. I have changed fill value of svg text but it will change the text color of all the text including axis lable values. Can someone pls help me with this ? 回答1: You need to use fill