Spline Area Graph for Clear Trend Visualization

Area graphs provide an excellent way to showcase changes in quantity over time. They are particularly useful for visualizing trends and comparing the magnitude of different categories within a dataset. Unlike line graphs, area graphs emphasize the cumulative value of each category, making them suitable for depicting proportions or totals. Common applications include financial data, website traffic analysis, and population demographics. The filled area beneath the line helps highlight the overall volume or quantity involved, making it easier to identify significant increases or decreases. Effective area graphs use clear legends, distinct colors, and appropriate labels for enhanced readability.


Economist GGPlot Excel Paul Tol Black And White Solarized Stata Tableau Wall Street CanvasXpress
<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" : [
              [10,11,13,4,18,21]
            ],
            "smps" : ["Jan","Feb","Mar","Apr","May","Jun"],
            "vars" : ["Value"]
         }
      }

      // Create the configuration for the graph
      var config = {
         "colorScheme" : "Prism",
         "graphOrientation" : "vertical",
         "graphType" : "Area",
         "lineType" : "spline",
         "showLegend" : false,
         "smpTextRotate" : 90,
         "smpTitle" : "Month / First Quarters of 2024",
         "title" : "Area graph with one series - Spline",
         "titleScaleFontFactor" : 1.2,
         "xAxis" : ["Value"],
         "xAxisTitle" : "Revenue (in Millions)"
      }

      // 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-area5-dat.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
canvasXpress(
  data=y,
  colorScheme="Prism",
  graphOrientation="vertical",
  graphType="Area",
  lineType="spline",
  showLegend=FALSE,
  smpTextRotate=90,
  smpTitle="Month / First Quarters of 2024",
  title="Area graph with one series - Spline",
  titleScaleFontFactor=1.2,
  xAxis=list("Value"),
  xAxisTitle="Revenue (in Millions)"
)