An area chart is really similar to a line chart, except that the area between the x axis and the line is filled in with color or shading. It represents the evolution of a numeric variable.
<!-- Include the CanvasXpress library in your HTML file --> <link rel="stylesheet" href="https://www.canvasxpress.org/dist/canvasXpress.css" type="text/css"/> <script src="https://www.canvasxpress.org/canvasXpress.min.js"></script> <!-- Create a canvas element for the chart with the desired dimensions --> <div> <canvas id="canvasId" width="600" height="600"</canvas> </div> <!-- Create a script to initialize the chart --> <script> <!-- Create the data for the graph --> var data = { "y" : { "data" : [ [10,100,70,130,60] ], "smps" : ["S1","S2","S3","S4","S5"], "vars" : ["A"] } } <-- Create the configuration for the graph --> var config = { "colorScheme":"CanvasXpress", "graphOrientation":"vertical", "graphType":"Area", "lineType":"rect", "objectBorderColor":"false", "showLegend":"false", "showSampleNames":"true", "showTransition":"false", "smpLabelRotate":"90", "smpTitle":"time" } <!-- Call the CanvasXpress function to create the graph --> var cX = new CanvasXpress("canvasId", data, config); </script>
library(canvasXpress) y=read.table("https://www.canvasxpress.org/data/cX-area4-dat.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE) canvasXpress( data=y, colorScheme="CanvasXpress", graphOrientation="vertical", graphType="Area", lineType="rect", objectBorderColor=FALSE, showLegend=FALSE, showSampleNames=TRUE, showTransition=FALSE, smpLabelRotate=90, smpTitle="time" )
Create New Page