block by timelyportfolio 417758092829c42dc96c

rCharts + dimple v2.0.0 step interpolation example 2

Full Screen

rCharts Using dimple.js v2.0.0 Interpolation

Recreate the grouped horizontal 100% step area chart from dimple.js with rCharts.

Note, as of now, will need to use the dimple v2.0.0 branch of rCharts.

install_github("timelyportfolio/rCharts@dimple_v2.0.0")

Interpolation options are not limited to step. See the full set of d3.js interpolate options.

code.R

#http://dimplejs.org/examples_viewer.html?id=area_steps_horizontal_grouped_100pct
d1 <- dPlot(
  data = subset(data, Owner %in% c("Aperture","Black Mesa")),
  #var myChart = new dimple.chart(svg, data);
  bounds = list(x=70,y=30,width=340,height=330),
  #myChart.setBounds(70, 30, 340, 330);
  x = c("Owner","Month"),
  #var x = myChart.addCategoryAxis("x", ["Owner", "Month"]);
  xAxis = list( grouporderRule = "Date" ),
  #x.addGroupOrderRule("Date");
  y = "UnitSales",
  yAxis = list( type = "addPctAxis" ),
  #myChart.addPctAxis("y", "Unit Sales");
  groups = "SKU",
  type = "area",
  #var s = myChart.addSeries("SKU", dimple.plot.area);
  interpolation = "step",
  #s.interpolation = "step";
  lineWeight = 1,
  #s.lineWeight = 1;
  barGap = 0.05,
  #s.barGap = 0.05;
  legend = list(
    x = 430,
    y = 20,
    width = 100,
    height = 300,
    horizontalAlign = "left"
  )
  #myChart.addLegend(430, 20, 100, 300, "left");
)
d1