d3.js

Making Nested JSON Javascript

依然范特西╮ 提交于 2021-01-28 19:58:51
问题 I am trying to make nested JSON for the sunburst diagram however I am having some trouble. As you can see in this fiddle below that the children that share a parent name are not being applied to everything? I want the No Virtual to have the same Attributes as the Virtual Parent. However because they are the same name I am running into a problem? Is there someway to check if the root of the tree are the same? And that way it can be different every time, however it is going to get more and more

d3js Pie chart gradient

安稳与你 提交于 2021-01-28 19:56:49
问题 Have been trying to build a pie/donut chart with smooth gradient on it but figured out that it's quite difficult to make. Already spent a lot of time and still haven't any luck how to resolve that problem. I'm using d3js library I have something similar to this And want to fill it with gradient, exactly like this Any advice how to make it more close to it. Maybe someone of you have already faced with that issue and have some knowledge about it. Will be appreciate for any answers and advices.

How to convert Data table to tree json format dynamically?

为君一笑 提交于 2021-01-28 19:01:08
问题 I'm using this data input to create a D3.js visualization: Tree Layout Okay so the right now my data input is a json file which i have hardcoded: { "name":"Fun", "children": [ { "name": "Legal", "children": [ { "name": "Adventure" }, { "name": "Movie" }, { "name": "M&m" } ] }, { "name": "frowned upon", "children": [ { "name": "recreational stuff" }, { "name": "religious views" } ] } ] } But my data input is actually : How do i convert this data table dynamically to the above mentioned Json

D3: change html in transition

瘦欲@ 提交于 2021-01-28 17:51:34
问题 In this (broken) minimal example, I want the text to fade out, change while invisible, and reappear with the changed content. This should be simple (no cross-fading), but the error message complains that .html is not a function. <!DOCTYPE html> <title>Image mask</title> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"> </script> <body> </body> <script> var textbox = d3.select('body').append('div'); textbox .html('Click me.') .style('cursor',

dc.js heatmap colour range not getting updated after filter applied

牧云@^-^@ 提交于 2021-01-28 14:20:17
问题 I'm using dc.js to create a dashboard, the dataset contains 3 types of reading from 1 year in a 24 hour basis. (in the example fiddle, i only use 15 days just for demonstration purpose) Here is the link to a JSFiddle to better illustrate my problem http://jsfiddle.net/table315/hLzLzhss/ I've used a row chart to show the total of each reading, and a heatmap to show the total reading of each day at each time. When 1 type of reading from the row chart has selected, the heatmap doesn't seems to

dc.js heatmap colour range not getting updated after filter applied

十年热恋 提交于 2021-01-28 14:20:17
问题 I'm using dc.js to create a dashboard, the dataset contains 3 types of reading from 1 year in a 24 hour basis. (in the example fiddle, i only use 15 days just for demonstration purpose) Here is the link to a JSFiddle to better illustrate my problem http://jsfiddle.net/table315/hLzLzhss/ I've used a row chart to show the total of each reading, and a heatmap to show the total reading of each day at each time. When 1 type of reading from the row chart has selected, the heatmap doesn't seems to

How to display polygons from .json data in d3.js?

谁都会走 提交于 2021-01-28 12:08:56
问题 I am trying to display a floorplan to my webapp using d3.js and vue js. The data comes from a .json file and is in a geojson format. I generated some test data from this geojson website. I was thinking I could use the d3.js path function to plot each different object to a svg element. Would this be the correct way to go about doing this? I have looked at this tutorial to make a united states map from geojson data. I was thinking this would be the right way to do it if you inputted different

Group D3 legend items

▼魔方 西西 提交于 2021-01-28 11:42:40
问题 How can I group the circle and text for each legend item? I am having an issue with enter / exit . I can create the groups ( g ), but I cannot append the text / circle elements. li.selectAll("g") .data(items, ([key]) => key) .call((d) => d.enter().append("text") .attr("y", (d, i) => (i * 1.25) + "em") .attr("x", "1em") .text(([key]) => key)) .call((d) => d.exit().remove()) .call((d) => d.enter().append("circle") .attr("cy", (d, i) => (i * 1.25 - 0.25) + "em") .attr("cx", 0) .attr("r", "0.4em"

How to add row in datatable - DC.js

那年仲夏 提交于 2021-01-28 11:33:56
问题 I have a json file that loads sales data for salespeople based on the current year and the previous year. I created a table in which I show the total sales for each year for each salesperson and, in the last row, I need to load the total for all salespeople added up. As shown in the image below: I am using dc.dataTable to create my table. Can you tell me if there is any way in DC.js to create a row in my table to put the total sales? Here is my code, thank you in advance. var vendedorTable =

Animate area of a d3 line graph

此生再无相见时 提交于 2021-01-28 11:24:32
问题 I am trying a transition of a d3 area. Here's the example link which I tried to follow. It is doing the area transition from outside the data line path. I need this transition to be from inside the data line area, and as the data line progresses the area transition should progress. Here's the StackBlitz link. And here's the code: maxAllowed = 0; graphData = [ { hrCount: 4, adjCount: 2 }, { hrCount: 8, adjCount: 5 }, { hrCount: 12, adjCount: 10 }, { hrCount: 16, adjCount: 13 }, { hrCount: 20,