nvd3.js

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

泪湿孤枕 提交于 2019-12-03 20:18:46
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 P value') timelyportfolio Actually, I think I discovered a solution thanks to this stack overflow

NVD3.js (d3.js) Scale Break

ぐ巨炮叔叔 提交于 2019-12-03 17:35:30
I want to create a chart with scale break on y axis. I don't want to use a non-linear scale but using a scale break make lower values more visible when having data anomalies. What is the best way to implement that in nvd3 or in general in d3? Lacking other options I created a brute force solution, manipulating the vertical <path> of the Y axis. Using pseudo code, you use it like this: var domainPath = yAxis .select('path.domain'); domainPath.attr('d', breakScale(domainPath.attr('d'), 14, 6, 4, 7); The breakScale function is not very special nor elegant, but here it goes: function breakScale

adjusting axis labels NVD3 graph in rCharts

安稳与你 提交于 2019-12-03 13:49:10
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, one categorical variable has 16 levels. When this variable is displayed along the x-axis of the

transitionDuration function does not exist in nvd3.js

落爺英雄遲暮 提交于 2019-12-03 12:26:08
I'm learning nvd3.js to draw charts. From a sample from the site, I pick following simple code to test: chart = nv.models.lineChart() .margin({ left: 100, right: 100 }) //Adjust chart margins to give the x-axis some breathing room. .useInteractiveGuideline(true) //We want nice looking tooltips and a guideline! .transitionDuration(350) //how fast do you want the lines to transition? .showLegend(true) //Show the legend, allowing users to turn on/off line series. .showYAxis(true) //Show the y-axis .showXAxis(true) //Show the x-axis But when I'm running the code it says that transitionDuration

How do you remove the background gridlines in nvd3.js?

老子叫甜甜 提交于 2019-12-03 10:19:42
I am making a bar graph in nvd3.js, similar to this example: http://nvd3.org/ghpages/discreteBar.html . I was wondering if there was a way to remove the gridline so the background would be plain white. All of the examples use gridlines. I also checked the source code and didn't see anything in the discreteBar model that would make this possible. You can select those grid lines in your CSS and set their opacity 0: .tick { opacity: 0; } If you still want to see the baseline, you could modify this to: .tick:not(.zero) { opacity: 0; } Use your browser's inspector tools to see what class the

D3js: When to use .datum() and .data()?

穿精又带淫゛_ 提交于 2019-12-03 04:46:18
问题 I often see .datum when an area chart is used. For example: svg = d3.select("#viz").append("svg").datum(data) Are there any rules of thumb for when .datum is needed? var area = d3.svg.area() .x(function(d) { return x(d.x); }) .y0(height) .y1(function(d) { return y(d.y); }); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); svg.append("path") .datum(data) .attr("d", area); 回答1: I think the documentation gives a good answer to this question: https://github

rChart in R Markdown doesn't render

对着背影说爱祢 提交于 2019-12-03 03:49:54
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.rstudio.com>. When you click the **Knit** button a document will be generated that includes both

How to use dynamic CSV data for visualisation with nvd3 and angular2

主宰稳场 提交于 2019-12-03 00:14:22
问题 I am trying to load a CSV data and plot graphs based on the returned data.I could see the data when logged to the console, but it does not get plotted in the graph. When I replaced the data copied from the console with the function written to return the data, the graph get plotted. I dont know what I am missing. my code looks like this // Options and Data definitions declare let d3, nv: any; export const ChartTypes = [ 'lineChart', 'discreteBarChart' ]; const color = d3.scale.category20()

How to highlight only certain coordinates in NVD3 line graph?

[亡魂溺海] 提交于 2019-12-02 21:26:08
问题 Can somebody tell me how to highlight only certain coordinates in a NVD3 line graph depending upon some condition like if x axis value is above 100,highlight that coordinate. please see the image at :http://i.stack.imgur.com/AHJaK.jpg This question or similar question has been asked , but I see no answers. Thanks in advance. How to highlight a point on a Simple Line Chart in NVD3? 回答1: The NVD3 API doesn't allow you do to that, so you have to "hack" it and highlight the data points you're

D3js: When to use .datum() and .data()?

浪尽此生 提交于 2019-12-02 19:06:29
I often see .datum when an area chart is used. For example: svg = d3.select("#viz").append("svg").datum(data) Are there any rules of thumb for when .datum is needed? var area = d3.svg.area() .x(function(d) { return x(d.x); }) .y0(height) .y1(function(d) { return y(d.y); }); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); svg.append("path") .datum(data) .attr("d", area); I think the documentation gives a good answer to this question: https://github.com/mbostock/d3/wiki/Selections#wiki-datum . Basically, the point is that in some cases you are not