nvd3.js

Angular UI-Grid and D3 graph in a row

做~自己de王妃 提交于 2019-12-05 02:34:35
问题 I am wondering if any of you had any experience with injecting a graph into a ui-grid. What I am doing, is I have a row defined as follows: { name:'Column Name', cellTemplate: '<spark-line-chart values="grid.appScope.valuesStacked"></spark-line-chart>'} Spark-line-chart directive is responsible for creating a D3 chart (actually, nvd3 to be precise). This creates svg graph. Now, each time I am trying to sort my table, all of the values within the table get sorted, apart from the graphs. So far

nvd3 scatterPlot with rCharts in R: Increase Font size of labels?

一笑奈何 提交于 2019-12-05 02:09:58
问题 I am trying to increase the font size of the x and y axis in the plot created using NVD3 and rCharts. Here is my code for the plot. Any help is appreciated. n1 <- nPlot(pValues~Chr,data=dat,type="scatterChart",height=400,width=750) n1$chart(tooltipContent= "#! function(key, x, y, e){ return '<b>ID:</b> ' + e.point.ID } !#") n1$chart(forceY = c(0,8)) n1$chart(forceX = c(0,10)) #n1$chart(color = '#! function(d){return d.pValues} !#') n1$xAxis(axisLabel = 'Chromosome') n1$yAxis(axisLabel = '-log

nvd3.js : unable to bind onClick event with the data points in the svg

不问归期 提交于 2019-12-05 01:14:54
I am trying to bind the datapoints with the onclick event, so that I could display a overlay box with some additional details and links. I'm using the .nv-point class to access the datapoints. The problem is that I'm unable to register the onclick event to those datapoints. Here is the code : d3.selectAll(".nv-point").on("click",function(){ alert("clicked"); //do something more }); Here is the demo in jsFiddle You can easily attach a click handler to the "circle", or node point on a lineChart like this: chart.lines.dispatch.on('elementClick', function(e) { alert("You've clicked on " + e.series

NVD3/D3 change y axis minimum value

房东的猫 提交于 2019-12-05 00:44:53
I am currently using NVD3 to make a few line charts. I am wondering if it is possible to make the y axis ticks to always start from 0. Currently it always starts from the lowest y value. I have tried using tickValues but I do not want to change the other values. I have also tried to add a data point with a value of 0, but this seems like a workaround and it affects the way the graph looks. Any ideas? You don't need to add a "dummy" data point, all you need is adjust the input domain of the scale, e.g. something like chart.yAxis.scale().domain([0, maxValue]); Most charts have a forceX and

adjusting axis labels NVD3 graph in rCharts

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 21:21:44
问题 I am using the rCharts nPlot() function to display stacked or grouped bar charts given contingency table type data. The "multiBarChart" is displayed in a shiny application. A piece of the code that I use in my shiny application is given below. graphData <- reactive({ as.data.frame(table(eval(inputVar1()),eval(inputVar2()))) }) output$myChart <- renderChart({ p1 <- nPlot(Freq ~ Var1, group="Var2", data=graphData(), type="multiBarChart") p1$addParams(dom='myChart') return(p1) }) In my dataset,

How do I access the x- and y-scale of the d3 plot in nvd3?

感情迁移 提交于 2019-12-04 15:42:03
I'm using nvd3 to plot some series and want to add some arbitrary rectangles to the plot. How can I access the underlying x- and y-scale for the d3 plot so I can transform my rectangles' coordinates into the svg pixel coordinates so that are on the same scale as the existing data: function d3_render(response) { nv.addGraph(function() { var data = response; chart.xAxis .axisLabel('Time (s)') .tickFormat(d3.format(',f')); chart.x2Axis .tickFormat(d3.format(',f')); chart.yAxis .axisLabel('Units normalized') .tickFormat(d3.format(',.2f')); chart.y2Axis .tickFormat(d3.format(',.2f')); d3.select('

rChart in R Markdown doesn't render

孤街浪徒 提交于 2019-12-04 10:01:35
问题 I am having issues rendering an rChart made with 'nPlot' when I knit an R Markdown document to html. I followed the solution discussed in this question, but it was unsuccessful. Here is my .Rmd code ```{r, echo=FALSE} library(knitr) ``` --- title: "Untitled" author: "Test" date: "01/23/2015" output: html_document --- This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown

NVD3.js multiChart x-axis labels is aligned to lines, but not bars

守給你的承諾、 提交于 2019-12-04 06:20:25
I am using NVD3.js multiChart to show multiple lines and bars in the chart. All is working fine, but the x-axis labels is aligned only to the line points, not bars. I want to correctly align labels directly below the bars as it should. But I get this: With red lines I marked where the labels should be. I made jsFiddle : http://jsfiddle.net/n2hfN/ Thanks! As @Miichi mentioned, this is a bug in nvd3... I'm surprised that they have a TODO to "figure out why the value appears to be shifted" because it's pretty obvious... The bars use an ordinal scale with .rangeBands() and the line uses a linear

NVD3 - Showing empty chart instead of noData message

天大地大妈咪最大 提交于 2019-12-04 04:15:30
Is there a way to show an empty chart instead of the "No Data Available" message when there is no data to show? http://jsfiddle.net/sammla/pYWkD/2/ data2 = [ { "key" : "A key" , "values" : [] } ]; Thanks! You can "hack" this by having an empty array that contains an empty array: data2 = [ { "key" : "A key" , "values" : [[]] } ]; The answer provided by Lars works well when you do not want to show the noData message on a chart when its empty. Recently I had charts with content being loaded dynamically. I found a similar question to this Updating with no data does not clear old data from the

nvd3 chart strange behavior with date range slider

大兔子大兔子 提交于 2019-12-04 02:39:06
问题 While displaying nvd3 chart with Ajax requests, the charts are getting wired up. So I thought the problem is occurring due to asynchronous call delays (may be the chart is displaying before the full data is loaded, etc). So I have used promises, but still I am getting the same problem. Please see the plunker http://plnkr.co/edit/AcIpmki7GNvcoT6Z38Pm?p=preview. If you change the date range slider, the main chart won't display properly. I am not sure where the problem is? After searching some