rcharts

Dimple dPlot color x-axis bar values in R

左心房为你撑大大i 提交于 2019-12-06 08:27:00
I'm attempting to set manual colors for Dimple dPlot line values and having some trouble. d1 <- dPlot( x="Date", y="Count", groups = "Category", data = AB_DateCategory, type = 'line' ) d1$xAxis(orderRule = "Date") d1$yAxis(type = "addMeasureAxis") d1$xAxis( type = "addTimeAxis", inputFormat = "%Y-%m-%d", outputFormat = "%Y-%m-%d", ) The plot comes out looking great, but I would like to manually set the "Category" colors. Right now, it's set to the defaults and I cannot seem to find a method of manually setting a scale. I have been able to set the defaults using brewer.pal, but I want to match

Strange symbol “” appearing from rChart sankey output in Shiny

一曲冷凌霜 提交于 2019-12-06 08:10:48
Here's a screenshot of the output: The problem seems to be with the $setLib() function. As depending on the directory given, it gives a corresponding string output. Providing the correct directory produces the symbol  . For example providing a URL produces this output without the chart: Code - sankeyPlot$setLib("https://github.com/timelyportfolio/rCharts_d3_sankey") Output - https://github.com/timelyportfolio/rCharts_d3_sankey/layouts/chart.html Here's a sample code to replicate the error: require(rCharts) require(rjson) require(shiny) links <- matrix(unlist( rjson::fromJSON( file = "http:/

How to change the axis title with rCharts, dPlot and dimple

守給你的承諾、 提交于 2019-12-06 06:04:17
How can I change the axis titles of a plot generated with rCharts and the dimple.js library? For example: library(rCharts) data(mtcars) mtcars.df <- data.frame( car = rownames(mtcars), mtcars ) d1 <- dPlot(x ="disp", y="mpg", groups=c("car", "cyl"), type ="point", data=mtcars.df) d1$xAxis( type = "addMeasureAxis") d1 The desired effect is to replace the variable name "disp" with a more complete piece of text as the axis title. I've tried adding arguments to the d1$xAxis() line like title="Displacement" and label="Displacement: but without success. Sorry I just saw this. Thanks John for

Highcharts Area Range Plot in rCharts

与世无争的帅哥 提交于 2019-12-06 03:56:39
does anyone know if it's possible to create a area range style plot in rCharts ( http://www.highcharts.com/demo/arearange-line )? My basic problem is the visualisation of a simple forecast scenario: set.seed(123134) y <- c(rnorm(20, 35, 2), rep(NA, 10)) data <- data.frame(y=y) data$fc <- c(rep(NA, 20), rnorm(10, 35, 1)) data$lci <- data$fc-1 data$uci <- data$fc+1 h1 <- Highcharts$new() h1$chart(type="line") h1$series(data=data$y, marker = list(symbol = 'circle'), connectNulls = TRUE) h1$series(data=data$fc, marker = list(symbol = 'circle'), connectNulls = TRUE) h1$series(data=data$uci,

Problems while reproducing Sankey chart example with d3_sankey

寵の児 提交于 2019-12-05 03:28:53
I am trying to reproduce simple example with rCharts library to plot sankey chart. I found this example from scratch and tried to reproduce it, however, I came up with some problems. Firstly I have tried running this code without nothing. Then I found out and realized, that I need d3_sankey in my computer. So, I have downloaded it from here and copied to C:\Users\adomas\Documents\R\win-library\3.0\rCharts\libraries\widgets\d3_sankey . Then I've tried that unchanged code once more and still got the following error: Error in file(con, "r") : cannot open the connection In addition: Warning

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

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,

Shiny renders a responsive rCharts leaflet map once, but is blank if you change the input variable

房东的猫 提交于 2019-12-04 20:21:05
I am producing a Shiny App that produces a leaflet (rCharts) map depending on which bus route you pick. Everything renders perfectly at first glimpse, but if you change the route number, an empty map appears (not even a tilelayer). This isn't specific to the route number. For example, I can pick any route number to produce the first plot successfully, whereas the second plot, regardless of route number, is blank. Has anyone come across this before? Is there a workaround? Here is a simple example. ui.R: library(shiny) library(rCharts) shinyUI(fluidPage( titlePanel("Responsive Leaflet Map using

R: rCharts and Shiny, charts won't show up when I run it

半城伤御伤魂 提交于 2019-12-04 18:42:12
This seems like an ongoing question. I saw this posted a few times, I tried all the different solutions people offered. But nothing works for me. My chart won't show up when I run it :( Here is my ui.R ## ui.R require('rCharts') require('shiny') require("quantmod") require("TTR") require("stringr") require('lubridate') options(RCHART_LIB = 'polycharts') shinyUI(pageWithSidebar( headerPanel('test'), sidebarPanel(p('test') ), mainPanel( showOutput('graph',lib='polycharts') ) )) and here is my server.R #Dependencies require('rCharts') require('shiny') require("quantmod") require("TTR") require(

Add polygon to map R leaflet

空扰寡人 提交于 2019-12-04 18:23:52
I am trying to display a map with R using the rCharts package. I am starting simple and so I want to add a polygon to my map. But I have no clue how. Any ideas? addPolygon doesnt work. map <- Leaflet$new() map$tileLayer(provider = 'Stamen.TonerLite') map$setView(c(48.1, 16.7), zoom = 10) map$addPolygon( c(48.99831, 49.08815, 49.08815, 48.99831, 48.99831), c(13.42666, 13.42666, 13.56383, 13.56358, 13.42666), layerId=c("1"), options=opts, defaultOptions=opts) map Add the polygon to your map by converting to geoJSON format, as in example 10 in the rCharts source code: https://github.com/ramnathv