• 如何得到D3中的前一个值来计算差值

    我正在制作一个索引图表,我想能够计算出以前的数据值和当前悬停的数据值之间的变化率。在多行图表中,你认为最好的方法是什么?我看过以前的一些帖子,但都是4-6岁的,而且不适合我。 const dateParser = d3.timeParse('%Y'); const formatYear = d3.timeFormat('%Y'); const xAccessor = d => dateParser(d.time.substring(0, 4)); const y0...
  • 如何获取d3.js条形图从0开始而不是从顶部开始

    我正在尝试构建一个仪表板,以条形图显示滑雪者的表现。在x轴上,我有不同的跑步次数(总共14跑步次数)。在Y轴上,我计算出的分数介于-1.5至1秒之间。最好是,我不希望这些栏从顶部开始。我希望它们从0开始。关于如何解决此问题的任何想法? Here's my index.html with all the d3.js code: the csv file can be found on csv <!DOCTYPE html> <html lang="en"> <head> <meta charse...
  • 如何根据下拉菜单中的选择呈现条形图?

    I am trying to create an interactive bar chart in d3.js. The data for this is a .csv file that stores all the runs for each BIB (that is, athlete). I have used d3.group() to group by BIB but I don't know how I can select the BIB in the dropdown menu so tha...
  • d3.js堆叠条形图-修改堆叠顺序逻辑

    I would like to create a stacked bar chart whereby the order of the rects is determined by data values (i.e. largest to smallest, tallest to shortest, richest to poorest, ect). To the best of my knowledge, after stacking data, the initial order seems to be...
  • 混淆更新根目录并向链接添加文本

    我正在尝试使用d3js构建一棵树。我有一棵两边的树,中间有根。我向着根的右边显示父母,向着根的左边显示孩子。这是我的代码。 var data = { "name": "Root", "img": "https://www.freelogodesign.org/Content/img/logo-samples/flooop.png", "children": [{ "name": "3", "img": "https://www.freelogode...
  • D3js甜甜圈图图例

    I want to add a legend to my D3js donut chart, like this post, its supposed to be kind of simple but I can't get it and I don't know what I'm doing wrong, also the console is not throwing any errors, anyone can see the error? 我的数据来自csv,看起来像这样: data = [{ ...
  • d3.js具有每个切片偏移起始角度的多层饼图

    I have a pie chart here https://codepen.io/dbousamra/pen/rNVyMNR 我试图建立这个: 注意派中第二个切片的角度和偏移量吗?我该如何实现? var width = 600, height = 450, maxRadius = Math.min(width, height) / 2; var svg = d3.select("body").append("svg") .attr("width", width) .a...
公告

欢迎访问 goshare  点击这里设置您的邮箱  可以接收站内跟帖、回复邮件提醒,不错过任何一条消息。

关注公众号订阅更多技术干货! 码农俱乐部