nvd3.js

Unable to plot chart with new data format

妖精的绣舞 提交于 2019-12-12 04:29:05
问题 I am converting my existing chart to support new data format. Old data format for X-axis: using dates in epoch format like 1356912000000 (Number) New data format for X-axis: using dates in regular format like "2012-12-31" (String) Format for Y-axis in the same (Number). Chart as per old data format: http://jsfiddle.net/rdesai/vfe2B/85/ Chart as per new data format: http://jsfiddle.net/rdesai/vfe2B/84/ For old format, I was converting the epoch date to regular date and feeding it to the ticks.

angular + d3 tickFormat using a string value for y

£可爱£侵袭症+ 提交于 2019-12-12 03:47:56
问题 I have the following chart config: nv.addGraph(function() { var chart = nv.models.cumulativeLineChart() .x(function(d) { return d.x.getTime() }) .y(function(d) { return d.y }) .color(d3.scale.category10().range()); chart.xAxis .axisLabel('Período') .tickFormat(function(d) { return d3.time.format("%m/%y")(new Date(d)); }); chart.yAxis .axisLabel('Rentabilidade') .tickFormat(function(d) { return (d * 100).toFixed(2) + '%'; }); d3.select('#profitability-chart') .datum(data) .transition()

NVD3 accessing a chart object

你说的曾经没有我的故事 提交于 2019-12-12 03:17:49
问题 In previous version's of nvd3 you can do the following to access the chart/graph object. chart = nv.graphs[0]; However in more recent versions this seems to have been removed: nv.graphs -> undefined nv.graphs[0] -> TypeError: nv.graphs is undefined Is there an alternative way to access the chart elements as such? chart = nv.graphs[0]; a = chart.brushExtent(); Here's a simple jsfiddle where you can see this in action as well, http://jsfiddle.net/0m8jzetx/3/ Here is the git issue where they

nvd3 tooltip not showing up after changing dataset

元气小坏坏 提交于 2019-12-12 03:06:06
问题 I'm providing a dropdown list for the user to choose which dataset the nvd3 chart is visualizing. Everything works fine, except the tooltip wouldn't show up after the dataset is changed. The strange thing is if I switch off something or switch between stacked and grouped (I'm using the multiBarChart model), the tooltip starts showing up again. I must be missing some steps, but I can't seem to figure out what it is. I've tried calling dispatch.stateChange(state) and dispatch.stateChange(state)

in nvd3 multibarchart, some stacks lose their colors or otherwise become invisible

与世无争的帅哥 提交于 2019-12-12 02:57:59
问题 How do I ensure that bars in multibarchart in nvd3 always starts from same level? What I am seeing is that some series start kinda "floating" in the air (actually one of the stacks loses its color) Please see http://jsfiddle.net/TZ2kH/1/ and click on "stacked" option (initial settings - that is another question) My data series is very short, just 3 rows - 2 in one sub-series and 1 in another sub-series. data_multiBarChart = [{ 'values': [ { 'y': 7, 'x': 9 }], 'key': 'Count', 'yAxis': '1' }, {

how to use d3.time.scale to create label for each hour of day and each day of week

百般思念 提交于 2019-12-12 02:27:19
问题 Ok there may be so many duplicates to this question on SO, i have checked almost all of them but i couldn't figure out answer to my quest I have this service which gives, count of hits to my site every minute and i want to display it in dashboard using d3 nvd3 line graph. I got all working except one thing, i want the labels on x axsis to start from midnight to midnight (00:00 to 23:00) and in intervals of 1hr [00:00, 01:00, 02:00, 03:00, 04:00, ......22:00, 23:00] But i am not able to get

Line And Bar Chart Combo in NVD3

给你一囗甜甜゛ 提交于 2019-12-12 02:20:57
问题 I am trying to make a graph that has bars and one single line but both obey the same Y axis. Nvd3.js have a Line+Bar chart but each series relies on separate Y Axis which doesn't give my data the real effect that it needs to show as the axis are offset to one another. If possible, I don't really want to go away from D3.js + NVD3.js if I can help it. Is there any way to create a bar and line chart in nvd3 or d3 that rely on the same axis? Here is an image of the result I would like in NVD3.

Display two rCharts NVD3 figures next to each other in rmarkdown

拈花ヽ惹草 提交于 2019-12-12 01:53:33
问题 I want to display two charts with the rCharts package, one next to the other, more or less like the two pies are displayed in this link: http://nvd3.org/examples/pie.html I have a partial solution using <iframe> , but the solution has three problems: It is too case specific Including controls becomes a complicated task It does not look too nice Minimum working example: --- title: "Example" output: html_document --- ```{r rcht, message=FALSE, echo=FALSE, results='asis'} library(rCharts) df<

How to hide first Y Axis line on an nvd3 chart?

荒凉一梦 提交于 2019-12-11 18:12:12
问题 Plnkr example: http://plnkr.co/edit/19D5cnrVYdUrMlblQARy?p=preview Screenshot from my app: I've tried modifying the CSS, however I was only able to remove the 2nd (right Y axis line), but not the first left Y axis line. What I've tried: .nv-y { display: none; } As well as all the lines from this answer: Alter first vertical grid line in nvd3 d3.selectAll('.nv-y').attr('display','none') d3.selectAll('.nv-y path').attr('opacity','0.1') d3.selectAll('.nv-y path').attr('display','none') My

How to Use sql queries to draw dynamic chart in NV D3?

ⅰ亾dé卋堺 提交于 2019-12-11 15:03:08
问题 The below code for horizontal bar chart works well but now i need to retrieve data from sql database accordingly the chart should change dynamically, so where could i insert sql queries in this code and what is the format please help me guys. <!DOCTYPE html> <meta charset="utf-8"> <head> <link href="Scripts/nv.d3.css" rel="stylesheet" type="text/css"> <script src="Scripts/d3.v3.js"></script> <script src="Scripts/nv.d3.js"></script> <script src="Scripts/utils.js"></script> <script src="Scripts