Skip to content

Instantly share code, notes, and snippets.

View ramnathv's full-sized avatar

Ramnath Vaidyanathan ramnathv

View GitHub Profile
@ramnathv
ramnathv / README.md
Last active August 29, 2015 13:56
Test Chart

Chart

Test

@ramnathv
ramnathv / code.R
Created February 27, 2014 16:11
Highcharts Tooltips
library(rCharts)
h1 <- hPlot(Pulse ~ Height, data = MASS::survey, type = "scatter", group = "Exer")
h1$set(tooltip = list(formatter =
"#! function(){
return '<b>X</b>:' + this.x + '<br/>' +
'<b>Y</b>:' + this.y
} !#"
))
h1
@ramnathv
ramnathv / README.md
Created February 28, 2014 11:14
Testing Viewer Option

This is to test some new functionality

@ramnathv
ramnathv / code.R
Created March 2, 2014 04:24
Highcharts with Date on x-Axis
df = structure(list(Date = structure(c(16075, 16082, 16082, 16089, 16096, 16096, 16103, 16110, 16110), class = "Date"), Type = c("Type-1", "Type-1", "Type-2", "Type-1", "Type-1", "Type-2", "Type-1", "Type-1", "Type-2"), Numbers = c(16, 82, 2, 177, 270, 3, 381, 461, 4)), .Names = c("Date", "Type", "Numbers"), row.names = c(NA, -9L), class = "data.frame")
# don't switch to scientific notation, since we want date to be
# represented in milliseconds
options(scipen = 13)
dat = transform(df, Date2 = as.numeric(as.POSIXct(Date))*1000)
h1 <- hPlot(Numbers ~ Date2, data = dat,
group = 'Type',
type = "line",
@ramnathv
ramnathv / README.md
Last active August 29, 2015 13:57
Morris Plot with Dynamically Sorted Legend

This demo shows how to customize the legend in a morrisjs plot, created using rCharts. If you hover over the line, you will observe that the order of the variables traj1 and traj2 in the legend switches based on which value is greater. This demo was created in response to a question posed on github.

@ramnathv
ramnathv / index.html
Created March 28, 2014 20:30
Test Chart
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='http://nvd3.org/assets/css/nv.d3.css'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://timelyportfolio.github.io/rCharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js' type='text/javascript'></script>
<script src='http://nvd3.org/assets/lib/fisheye.js' type='text/javascript'></script>
@ramnathv
ramnathv / index.html
Created March 28, 2014 20:31
Test Chart
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='http://nvd3.org/assets/css/nv.d3.css'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://timelyportfolio.github.io/rCharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js' type='text/javascript'></script>
<script src='http://nvd3.org/assets/lib/fisheye.js' type='text/javascript'></script>
@ramnathv
ramnathv / index.html
Created March 29, 2014 18:20
NVD3 Scatter
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='http://nvd3.org/assets/css/nv.d3.css'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://timelyportfolio.github.io/rCharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js' type='text/javascript'></script>
<script src='http://nvd3.org/assets/lib/fisheye.js' type='text/javascript'></script>