d3.js

How to create graph with two tables being all dynamic?

十年热恋 提交于 2020-02-05 02:11:10
问题 I need to complete a sales history test that the company where I work passed me. Where they already get sales data through power bi, and I need to do the same thing but in D3. Here is the image of the graph and tables at the moment: This image shows a graph and two tables, all three of which are directly related. In the graph, the sales value is rendered according to the item (line) that is selected in the table. The default Initial value is the Total line. I'll explain one by one, so I can

dc.js Box plot reducer using two groups

谁说我不能喝 提交于 2020-02-04 20:56:13
问题 I'm trying to produce a box plot which will show the total number of networks single devices have connected to grouped by their vendor. Data Format: { "SSID": "eduroam", "identifier": "Client", "latitude": 52.4505, "longitude": -1.9361, "mac": "dc:d9:16:##:##:##", "packet": "PR-REQ", "timestamp": "2018-07-10 12:25:26", "vendor": "Huawei Technologies Co.Ltd" } Fiddle with data https://jsfiddle.net/v4a8g2bo/ I have managed to get a sum of the networks a single device has connected to using the

d3 v4 - drag 'clickDistance' doesn't seem to have any effect

喜夏-厌秋 提交于 2020-02-04 05:38:26
问题 I have a d3 element 'itemGroup' which has other elements within it. One of these is a text label that I'd like to subscribe to the click events of. Additionally, I'd like the itemGroup to be draggable. Without the code below the click events fire as expected. With the below code I get the drag behaviour I want, but the click event on the child element of itemGroup no longer fires. d3.selectAll(".itemGroup").call(d3.drag().clickDistance(4).on("start", started)); I thought that 'clickDistance'

How to Use D3 elements inside SAP UI5 , when using JS views?

徘徊边缘 提交于 2020-02-03 10:46:45
问题 Suppose we want to use D3 JS library data visualization ability and use it inside SAP UI5 application , ( already using VIZ library which is based on D3 in sap.m but want to have more elements and more capabilities to represent data ) Is it possible and advisable ? If yes ,then are there any other framework based on D3 library which can be utilized to do the integration as SAP UI5 is a object oriented framework and writing D3 code inside the view is not working ? Find below the failed trial

d3.js area graph with initial zoom

こ雲淡風輕ζ 提交于 2020-02-03 10:39:31
问题 I am trying ti implement a zoom and brush chart with D3.js with an initial zoom. The initial zoom covers only about 10% of the brushable extent - this works correctly. When I zoom on the chart the first time, the zoom does not take into account the initial state. Here's the graph initially: And after the first zoom: Here's a plunkr, and the relevant code: svg.append("rect") .attr("class", "zoom") .attr("width", width) .attr("height", height) .attr("transform", "translate(" + margin.left + ","

d3.js area graph with initial zoom

夙愿已清 提交于 2020-02-03 10:39:10
问题 I am trying ti implement a zoom and brush chart with D3.js with an initial zoom. The initial zoom covers only about 10% of the brushable extent - this works correctly. When I zoom on the chart the first time, the zoom does not take into account the initial state. Here's the graph initially: And after the first zoom: Here's a plunkr, and the relevant code: svg.append("rect") .attr("class", "zoom") .attr("width", width) .attr("height", height) .attr("transform", "translate(" + margin.left + ","

How to get quantize values

孤人 提交于 2020-02-03 09:46:44
问题 is there a way to get the start and end values of the quantizes of an quantize scale. The range is defined by 5 colors ans the domain by d3.min and d3.max function on my data from an json file. I need them for my legend of an choropleth map. Thank you for helping. Carsten Thats my code var quantizecolors = ["#d7191c","#fdae61","#ffffbf", "#a6d96a","#1a9641"]; var colorEnerg = d3.scale.quantize().range(quantizecolors); colorEnerg.domain([ d3.min(collection.features, function(d){return d

d3.js: dataset array w/ multiple y-axis values

怎甘沉沦 提交于 2020-02-03 08:25:10
问题 I am a total beginner to d3.js so please be kind :) considering this jsbin example I have the following dataset: var dataset = [ [d3.time.hour.utc.offset(now, -5), 1, 10], [d3.time.hour.utc.offset(now, -4), 2, 20], [d3.time.hour.utc.offset(now, -3), 3, 30], [d3.time.hour.utc.offset(now, -2), 4, 40], [d3.time.hour.utc.offset(now, -1), 5, 50], [now, 6, 60], ]; Two questions. Does d3 provide a better approach to finding the max value for my y-axis data (all columns but the 0th, the 0th column is

Is it possible to set custom attributes of SVG objects as number and not as string?

a 夏天 提交于 2020-02-03 04:45:10
问题 I am assigning artificial attributes to a SVG-G element (SVG group object). I move the group with its content with SVG transformations and I store the x/y coordinates of the group and its width/height in those attributes. I am using the D3 Javascript library and the call : embeddedElemContainer = nodeBoxContainer.append('svg:g') .attr('x', x) .attr('y', y) .attr('width', width) .attr('height', height) results in following object : <g transform="translate(13.585786437626904,31.585786437626904)

Is d3.json() function can get json object?

[亡魂溺海] 提交于 2020-02-03 04:14:59
问题 I am new to JQuery / d3js world. I would like to draw a chart from data in json format. I saw i some samples that d3.json(json,f) function can get only file with data in json format. My question: is it possible to call it with json like object or string in json format,for example: val jsonStr = { "foo" : "bar"} d3.json(jsonStr ,f) If not how can I draw a chart with dynamic data (in json format) 回答1: If you have the data as a Javascript variable, you don't need the d3.json function. Simply use