Kaplan-Meier Chart

Kaplan-Meier plots can be created with the function addKaplanMeierCurve. This function takes four parameters: (1) the sample name of the Time variable, (2) the sample name of the censored polulation, (3) the label to display in the legend for the censored population and (4) the color for the label and the Kaplar-Meier plot. Many Kaplan-Meier lines may be ploted in the same graph by providng additional sample series.

# kaplan-meier-1

Simple Kaplan Meier Plot.

Show code Edit in jsfiddle Show R code Show Data in table


The data in json format in shown below. You can edit the data and its configuration in JS Fiddle through the file menu under File → Edit in JS Fiddle. For convience you can click this Edit in jsfiddle.

You can also see the data and in a table format through the toolbar on the right top by clicking on the table icon or through the file menu under Explore → Table. See additional information under User Interfaces. For convience you can click this Show Data in table.

   "y" : {
      "data" : [
      "smps" : ["Time","Censor","Censor1"],
      "vars" : ["p1","p2","p3","p4","p5","p6","p7","p8","p9","p10","p11","p12","p13","p14","p15","p16","p17","p18","p19","p20"]


The configuration for the visualization above is shown below. You can always access the data and its configuration in any CanvasXpress visualization through the file menu under File → Reproducible Research → Show JSON code. See additional information under User Interface - Menus. For convience you can click this Show code.

   "graphType" : "Scatter2D",
   "showConfidenceIntervals" : "false",
   "showDecorations" : "true",
   "showLegend" : "false",
   "showTransition" : "false",
   "title" : "Kaplan-Meier Plot"


In this example a function is called after the visualization is rendered to show the programatic access of a CanvasXpress object. The first line in the code below access the CanvasXpress instance by accessing it through the id of the canvas in the DOM and the next line(s) apply the corresponding functions. See additional information under Instances.

var cX = CanvasXpress.$("canvasId");

# Events and Functionality

Out of the box events

Events are pre-configured in all CanvasXpress visualizations. Refer to documentation to further customize events. Most visualizations have mouseover, click, dbl-click, wheel, context-menu, drag and drop. Press the 'ESC' key to reset the plot.

User Interfaces for exploring and configuring visualization

All visualization come with multiple user interfaces to allow data exploration and configuration. Dbl-click to bring configurator, context-menu to open menus, mouse-over top right to visualization to show toolbar and select either the funnel to open filters and data table or the tools to open the data explorer. See further documentation under User Interfaces.

Drag'n Drop files on the CanvasXpress Visualization

You can drag and drop any delimited text file on the visualization to create a new CanvasXpress plot. Similarly, you can drag and drop formated XML files from Wikipathways, KeGG, Metabase or GML. Furthermore, you can also drag and drop png or json files previously saved in CanvasvasXpress to re-create the visualization.