rcharts

rCharts-How to add axis lables and Headings to NVD3 chart

蹲街弑〆低调 提交于 2019-12-12 07:46:06
问题 I am exploriing rCharts. I got stuck while adding Lables to Y axis and Headings. I am new to rCharts. This is my sample code require(rCharts) n2 <- nPlot(Hours ~ Month, group = "Task", data = cars, type = "multiBarChart", height = 900, width = 1110) n2$xAxis(axisLabel = 'Year and Month') n2 Please help. 回答1: answer supplemented with title examples 2013-12-05 I cannot remember why nvd3 with rCharts does this but we have discovered this in this issue. The method suggested in that issue works,

Add values to rCharts hPlot tooltip

半世苍凉 提交于 2019-12-12 07:35:50
问题 I would like to add some extra values to the standard Highcharts tooltip via rCharts. Example code: require(rCharts) df <- data.frame(x = c(1:5), y = c(5:1), z = c("A", "B", "C", "D", "E"), name = c("K", "L", "M", "N", "O")) h1 <- hPlot(x = "x", y = "y", data = df, type = "scatter", group = "z") This generates a tooltip with the x and y values. And the series name z as title. Now I also want the to add the name values to the tooltip. However I have no idea how this is done. 回答1: After several

Strings as tick values for rCharts NVD3 line chart

偶尔善良 提交于 2019-12-12 05:03:12
问题 I'm trying to use display categorical levels in the x-axis of my line chart. Say I have a data frame mydata <- data.frame(time = c("10am", "12pm", "3pm"), month = c("JAN", "JUL", "DEC"), value = 3:5) and I want to plot value ~ time or value ~ month . I could first create a variable that puts time on a linear scale, e.g. mydata$time_linear <- 1:3 then try to plot library(rCharts) p <- nPlot(value ~ time_linear, data = mydata, type = "lineChart") p$chart(useInteractiveGuideline = TRUE) p but I

rcharts highcharts plotLines

懵懂的女人 提交于 2019-12-12 02:57:53
问题 I am having a little trouble to draw a horizontal line by using rcharts (highcharts) on a plot. I would like to use the plotLines from highcharts library to do this. Below is my code: a$yAxis(title='my_Yaxis name', plotLines=list(color='red', value=10, width=2)) Without the plotLines, my chart display with no problem. Once i added in the plotLines, it is not working. I am not sure if rcharts support plotLines in highcharts? Appreciate if any experts here can give advice. Thanks! 回答1: Hello

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<

Problems with spiderweb graph from Highcharts in R

冷暖自知 提交于 2019-12-12 01:47:19
问题 I've got some problems using spiderweb graphs from rCharts. Graph is not displaying as it should be. Any ideas ? library(shiny) library(rCharts) runApp( list(ui = fluidPage( tags$head(tags$script(src = "https://code.highcharts.com/highcharts.js"), tags$script(src = "https://code.highcharts.com/highcharts-more.js"), tags$script(src = "https://code.highcharts.com/modules/exporting.js"), tags$script(src = "https://code.highcharts.com/modules/heatmap.js") ), titlePanel(""), tabsetPanel( tabPanel(

Reorder factor in MultiBarChart with NVD3 rCharts

爱⌒轻易说出口 提交于 2019-12-11 20:13:11
问题 Is there any way to reorder the factor as such Red,Black,Brown,Blond require(rCharts) hair_eye_male <- subset(as.data.frame(HairEyeColor), Sex == "Male") n2 <- nPlot(Freq ~ Hair, group = 'Eye', data = hair_eye_male, type = 'multiBarChart') n2 Thanks 回答1: Reordering factors is an old art. Not to knock it...it's fun In this context I'd revalue the data first. So if you wanted to have red,black,brown,blond appear in that order on the x axis...Add a new variable to your initial dataframe that

rChart forceY multiBar “Bar start” not correct in rmarkdown

穿精又带淫゛_ 提交于 2019-12-11 12:30:03
问题 when I run the r code in the console, I get the output I expected, but when I run it in rmarkdown I get this result: The complete rmarkdown minimum example looks like this: --- title: "Untitled" author: "sda" output: html_document --- ```{r} library(dplyr) library(tidyr) library(rCharts) library(data.table) ``` ```{r results = 'asis', comment = F, message = F, tidy = F, echo=F, cache=F} myData <- data.table(XAxis = rep(seq(0,length.out = 3),each = 2), Value = c(0.6,0.8,0.4,0.55,0.87,0.42),

rCharts with shiny, no rescaling of bars after hide/unhide with Highcharts

空扰寡人 提交于 2019-12-11 11:54:43
问题 I have a simple shiny application (consisting of two files, server.r and ui.r) which uses the rCharts package with Highcharts. It runs pretty good, but if I choose to make all the bars disappear and then to display them again, they won't rescale. Here is the code, which is based on a simple example provided on rCharts' GitHub: ui.r require(rCharts) options(RCHART_LIB = 'highcharts') shinyUI(pageWithSidebar( headerPanel("App title"), sidebarPanel( helpText('A simple text.') ), mainPanel

Add vertical line to line chart in rChart NVD3 (nPlot)

倾然丶 夕夏残阳落幕 提交于 2019-12-11 09:56:00
问题 I would like to add several vertical lines indicating particular events in a line chart created with nPlot. Any suggestions? library(reshape2) library(ggplot2) library(rCharts) ecm <- reshape2::melt(economics[,c('date', 'uempmed', 'psavert')], id = 'date') p7 <- nPlot(value ~ date, group = 'variable', data = ecm, type = 'lineWithFocusChart') Final goal: add vertical lines with labels at 'date' = '1967-11-30', '2001-11-30', '1968-01-31', etc. 回答1: Ok, so this should answer the question. I