Waterfall Chart

A waterfall chart is a form of data visualization that helps in understanding the cumulative effect of sequentially introduced positive or negative values. These intermediate values can either be time based or category based.



Color Themes


{
   "x" : {
      "Status" : ["PD","PD","PD","PD","PD","PD","SD","PD","PD","PD","PD","PD","SD","SD","SD","PR"],
      "Tissue" : ["Pancreas","Pancreas","Pancreas","Colrectal","Breast","Colrectal","Colrectal","Colrectal","Billiary tract","Colrectal","Esophagus","Billiary tract","Billiary tract","Billiary tract","Colrectal","Billiary tract"]
   },
   "y" : {
      "data" : [
        [115,75,39,23,22,15,12,10,10,10,5,4,2,-8,-11,-31]
      ],
      "smps" : ["1001","1002","1003","1004","1005","1006","1007","1008","1009","1010","1011","1012","1013","1014","1015","1016"],
      "vars" : ["Shrinkage"]
   }
}
{
   "colorBy" : "Tissue",
   "colorScheme" : "NEJM",
   "graphOrientation" : "vertical",
   "graphType" : "Bar",
   "legendInside" : "true",
   "legendPosition" : "topRight",
   "showSampleNames" : "false",
   "smpOverlayProperties" : {
      "Status" : {
         "position" : "bottom",
         "scheme" : "White"
      }
   },
   "smpOverlays" : ["Status"],
   "title" : "Clinical Trial",
   "xAxis2Show" : "false",
   "xAxisTitle" : "Best tumor shrinkage (%)"
}
library(canvasXpress)
y=read.table("https://www.canvasxpress.org/data/cX-waterfall2-dat.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
x=read.table("https://www.canvasxpress.org/data/cX-waterfall2-smp.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
canvasXpress(
  data=y,
  smpAnnot=x,
  colorBy="Tissue",
  colorScheme="NEJM",
  graphOrientation="vertical",
  graphType="Bar",
  legendInside=TRUE,
  legendPosition="topRight",
  showSampleNames=FALSE,
  smpOverlayProperties=list(Status=list(position="bottom", scheme="White")),
  smpOverlays=list("Status"),
  title="Clinical Trial",
  xAxis2Show=FALSE,
  xAxisTitle="Best tumor shrinkage (%)"
)