nvd3.js

NVD3 (D3 JS) how to remove y2 axis

泪湿孤枕 提交于 2019-11-29 15:22:50
I'm trying to use the following example which is a line and bar chart combined. NVD3 Line & Bar Chart combination The problem I have is that I want the line chart and bar chart to both use the same figures from y1 axis, but I can't find out how to get rid of the y2 axis and do this. If someone could point me in the right direction it'd be a great help. Thanks in advance. Edit: A JSFiddle of the problem I'm experiencing. I'm just using the example from NVD3's download and have added in Lars' code just before the return chart; line. JSFiddle There's no option to disable the second y axis. What

NVD3 Line chart tics wrongly aligned to grid when using datetype on xAxis

*爱你&永不变心* 提交于 2019-11-29 15:18:24
I am currently working with NVD3 using Angular Directive (angular-nvd3). I have a very simple line chart with very simple data. The problem I have encountered now is that my data is wrongly aligned with the Axis. Example plunker available here: http://plnkr.co/edit/jWEYt6?p=preview , I am using dates on my xAxis, which are parsed using d3 library: tickFormat: function(d) {return d3.time.format('%d/%m')(new Date(d))} Description: I would expect the xAxis labels to be correspondent to the grid. In the example you can clearly notice that the xAxis is not evenly devided (values: 06/11, 08/11, 11

nvd3 scatterPlot with rCharts in R: Vary size of points?

淺唱寂寞╮ 提交于 2019-11-29 14:33:17
问题 I've been playing with rCharts and nvd3 for a bit of time now. Now I'm in a situation where I need a bubble chart, or at least a scatterplot where the size of the dots is dependent on a variable in the data. From this example, it seems possible. The example on scatter charts in rCharts is: library(rCharts) p1 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart') p1$xAxis(axisLabel = 'Weight') p1 So I've tried setting size to, for example gears . But it doesn't change

How do I change the legend position in a NVD3 chart?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 11:40:11
问题 Does anyone know how to reposition the legend in a NVD3 chart relative to the graph itself? It is on top by default, and I would like it to go on the side (better use of space within my app) An example of what I would like to do: 回答1: There is AFAIK no option to do this, but you can select the g element that contains the legend manually and move it, e.g. d3.select(".nv-legendWrap") .attr("transform", "translate(100,100)"); 回答2: As of this writing (2 jul 2015) nvd3 supports putting the legend

How to display values in Stacked Multi-bar chart - nvd3 Graphs

三世轮回 提交于 2019-11-29 11:14:55
I got a scenario where in I need to display value for every stack in stacked multi-bar chart - nvd3 graph as we can display value in discrete value - nvd3 graph. I understand, 'showvalue' is used in discrete bar controller , can we use showvalue in stacked graph, if not please suggest with an alternative solution. Thanks in advance Currently isn't possible. That option is available only in the discrete bar chart. From the maintainer: We don't have this ability. Stacked/Grouped charts also have complex animations making this a tricky thing to solve. We use tooltips instead. Source https:/

NVD3 line chart with realtime data

一笑奈何 提交于 2019-11-29 08:33:54
问题 I have a really simple line chart written using NVD3.js. I've written a simple redraw based on timer, pulled from examples I've seen, but I get the error Uncaught TypeError: Cannot read property 'y' of undefined The JS is var data = [{ "key": "Long", "values": getData() }]; var chart; nv.addGraph(function () { chart = nv.models.cumulativeLineChart() .x(function (d) { return d[0] }) .y(function (d) { return d[1] / 100 }) .color(d3.scale.category10().range()); chart.xAxis .tickFormat(function

NVD3 Scatter Chart Circle Radius

醉酒当歌 提交于 2019-11-29 08:02:05
I was wondering how I can set minimum and maximum radii of the circles in an NVD3 scatter chart. NVD3 Scatter: http://nvd3.org/ghpages/scatter.html Call .sizeRange([minArea, maxArea]) on your chart object. Note that "size" is proportional to area, not radius, so you need to use the square of the maximum/minimum radius (adjusted by pi/2 if you want to be precise). As of 1.7.1, call .pointRange([minArea,maxArea]) . nv.addGraph(function() { var chart = nv.models.scatterChart() .showDistX(true) .sizeRange([1000, 100]) /*****Chart Circle Range******/ .showDistY(true) .color(d3.scale.category10()

How to disable some streams by default in a nvd3 Simple Line Chart?

妖精的绣舞 提交于 2019-11-29 06:57:12
问题 I have several lines and I know that clicking on the "dot" in the legend will hide/show it. However, I need to start with some of the lines being disabled and not displayed, and the user will have to click on the dot in the legend to show it on the graph. (eg. I graph the number of questions on stackoverflow per language, but with C, PHP and javascript disabled by default). the graph only shows python, ruby... but on the legend, you have all the languages, including C, PHP and js with these 3

NVD3 Charts not rendering correctly in hidden tab

独自空忆成欢 提交于 2019-11-29 05:36:20
I am building a page which contains many charts, which are displayed one at a time depending on which tab you are looking at. The chart in the initially active tab renders correctly. However when I click to another tab, the chart is not rendered properly. Presumably this is because the hidden field does not have dimensions until it is made visible. In fact if I resize the window the chart will correct it's proportions, and render so that it fills the available width. I can fix this problem by explicitly defining the chart size via css, but this defeats the responsive aspect of the charts. Can

How to do wordwrap for chart labels using d3.js

感情迁移 提交于 2019-11-29 03:56:16
I am trying to implement the horizontal bar chart using d3.js.Some of the chart labels are too long. How to do word wrap for the chart labels on y aixs? Source code: var data = [{"Name": "Label 1", "Count": "428275" }, { "Name": "Label 2", "Count": "365005" }, { "Name": "Label 3", "Count": "327619" }]; var m = [30, 10, 10, 310], w = 1000 - m[1] - m[3], h = 550 - m[0] - m[2]; var format = d3.format(",.0f"); var x = d3.scale.linear().range([0, w + 10]), y = d3.scale.ordinal().rangeRoundBands([0, h], .4); var xAxis = d3.svg.axis().scale(x).orient("bottom").tickSize(h), yAxis = d3.svg.axis().scale