dygraphs

Print Dygraph chart

亡梦爱人 提交于 2019-12-11 09:26:10
问题 I'm trying to print a Div, containing a dygraph as follows: javascript: <script type="text/javascript"> function PrintElem(elem) { Popup(document.getElementById(elem).innerHTML); } function Popup(data) { var mywindow = window.open('', 'my div', 'height=400,width=800'); mywindow.document.write('<html><head><title>my div</title>'); mywindow.document.write('</head><body >'); console.log(data); mywindow.document.write(data); mywindow.document.write('</body></html>'); mywindow.print(); mywindow

X axis date format dygraph

大兔子大兔子 提交于 2019-12-11 08:47:53
问题 i am trying to format axis date data to make it show the year also but nothing happened i am using dygraph-combined.js document.getElementById("graphdiv"), // CSV or path to a CSV file. "Date,Temperature\n" + "2014-05-07,75\n" + "2014-05-15,70\n" + "2014-05-23,80\n"+ "2014-05-30,72\n" ,{ axes: { x: { axisLabelFormatter: function(d, gran) { return Dygraph.dateAxisFormatter(new Date(d.getTime() + 7200*1000), gran); } } } } ); 回答1: Because all of your dates fall in the same month, dygraphs has

Adding extra information to dygraph legend?

孤者浪人 提交于 2019-12-11 04:56:31
问题 Is there an easy way to be able to add extra data to the dygraph legend? I obviously want to display the x & y data values, but the underlying data point holds extra information that I want to show to the user. I can obviously use the callback option to find out what point has been moused over . So is the only option to use the callback and then have my own div which shows this information rather than using the dygraph legend? 回答1: The easiest way to do this is with the legendFormatter option

resizing tabbed dygraph window

本秂侑毒 提交于 2019-12-11 03:45:57
问题 I'm using jquery and dygraphs to make a simple page with tabs for each dygraph plot. When I resize the browser window, the active tab works fine but when I click the other tab the graph doesn't appear. If I resize the browser again, the missing graph will appear. I would like both graphs to appear in their respective tabs after resizing the browser once. Thanks in advance. Fiddle: tabbed dygraph HTML <div class="profiles"> <ul class="tabs"> <li><a href="#graphdiv1">Profile 7</a></li> <li><a

Dygraphs: JS function working for axisLabelFormatter but not for valueFormatter

大憨熊 提交于 2019-12-11 02:13:41
问题 I am working on a Shiny app for visualizing a manufacturing proccess data with Dygraphs package. My data look like this (Time in seconds): Time Var1 Var2 0.05 0.2199809 180.2101 0.10 0.2199809 180.1942 0.15 0.2358754 180.1465 0.20 0.2222697 180.1306 0.25 0.2222697 180.1306 0.30 0.1768748 180.1465 First of all I transform my data into xts format (I multiply by 1000 because Dygraphs collapses the observations inside the same second when plotting and I cannot solve this problem): data_xts<-xts

Is there a way to highlight closest series in R dygraphs?

社会主义新天地 提交于 2019-12-11 01:31:57
问题 I am using dygraphs for R https://rstudio.github.io/dygraphs/ and I am wondering is there a way to highlight closest series like it is done in original dygraphs? Demo gallery here: http://dygraphs.com/gallery/#g/highlighted-series I am really unfamiliar with CSS nor HTML. Thanks for any help and advice. 回答1: If you just want to highlight the series below mouse cursor then you can use dyHighlight . Check: official R-dygraph website It is a little more tricky to emphasize the name of the

Multiples annotations (with a data.frame) in dygraphs with R

别等时光非礼了梦想. 提交于 2019-12-11 00:58:22
问题 There is a package in R for dygraphs, and it is possible to add annotations: https://rstudio.github.io/dygraphs/gallery-annotations.html dygraph(presidents, main = "Quarterly Presidential Approval Ratings") %>% dyAxis("y", valueRange = c(0, 100)) %>% dyAnnotation("1950-7-1", text = "A", tooltip = "Korea") %>% dyAnnotation("1965-1-1", text = "B", tooltip = "Vietnam") I would like to how it is possible to create a data.frame in order to organise all annotations and add with a single

dygraphs - Hide series from Legend

回眸只為那壹抹淺笑 提交于 2019-12-11 00:31:58
问题 i'm trying to build a dynamic chart with 3 series using Dygraphs, the problem is that i'm not able to make the chart shows only one of them in legend. I have 3 series named "Prec", "Val" and "Now", everytime a user passes with cursor over the chart my goal is to show in the legend only value from "Val" serie. My series data are given in "native" format, in other words it's an array of value with date in the first element: va data = { [ X, Open, Val, Now], [ 2015-11-26, 1002, 1024, 1026], [

Dygraph showing dates in an arbitrary Timezone

夙愿已清 提交于 2019-12-10 19:24:51
问题 I needed to get Dygraph to respect arbitrary timezones. All dates shown in/on/around the graph should be able to be shown in an arbitrary timezone. The problem: Javascript does not support timezones other than the browser local timezone. There are libraries out there (timezone-js, moment-js with moment-timezone-js) to address this, but Dygraph doesn't know about them. 回答1: UPDATED answer, now works with Dygraph version 1.1.1. For old answer skip past horizontal rule. There is now an easier

dygraph in knitr not working

半世苍凉 提交于 2019-12-10 17:47:26
问题 When trying to Knit my dygraph in R using Knitr: library(dygraphs) dygraph(nhtemp, main = "New Haven Temperatures") %>% dyRangeSelector(dateWindow = c("1920-01-01", "1960-01-01")) I get the following error: ## Error in validateCssUnit(sizeInfo$width): "\maxwidth" is not a valid CSS unit (e.g., "100%", "400px", "auto") Could anyone assist with how I can possibly fix this or what it means? EDIT: Example code. \documentclass{article} \begin{document} <<include=FALSE>>= library(knitr) options