A simple representation of one value.
<head> <!-- 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/dist/canvasXpress.min.js"></script> </head> <body> <!-- 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 = { "x" : { "Quarter" : ["Q1","Q1","Q1","Q2","Q2","Q2","Q3","Q3","Q3","Q4","Q4","Q4"] }, "y" : { "data" : [ [1000,5000,4000,2000,7000,9000,8000,3000,2000,6000,5000,10000] ], "smps" : ["January","February","March","April","May","June","July","August","September","October","November","December"], "vars" : ["Revenue"] } } // Create the configuration for the graph var config = { "graphType":"Meter", "meterGroup":"Quarter", "meterSummary":"sum", "meterType":"digital", "meterVar":"Revenue" } // Call the CanvasXpress function to create the graph var cX = new CanvasXpress("canvasId", data, config); </script> </body>
library(canvasXpress) y=read.table("https://www.canvasxpress.org/data/cX-meter3-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-meter3-smp.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE) canvasXpress( data=y, smpAnnot=x, graphType="Meter", meterGroup="Quarter", meterSummary="sum", meterType="digital", meterVar="Revenue" )