Meter Chart

A simple representation of one value.


Example Color Themes

Example Fonts

Show Code

Tools

<html>

  <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 = {
         "y" : {
            "data" : [
              [85]
            ],
            "smps" : ["January"],
            "vars" : ["Performance"]
         }
      }

      // Create the configuration for the graph
      var config = {
         "graphType" : "Meter",
         "meterMax" : 100,
         "meterMin" : 0,
         "meterSegments" : [0,25,50,75,100],
         "meterType" : "digital"
      }

      // Event used to create graph (optional)
      var events = false


      // Call the CanvasXpress function to create the graph
      var cX = new CanvasXpress("canvasId", data, config, events);

      
    </script>

  </body>

</html>
library(canvasXpress)
y=read.table("https://www.canvasxpress.org/data/r/cX-meter-dat.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
canvasXpress(
  data=y,
  graphType="Meter",
  meterMax=100,
  meterMin=0,
  meterSegments=list(0, 25, 50, 75, 100),
  meterType="digital"
)