Exponential growth area with the recent period highlighted
Time series charts in CanvasXpress show how values change over calendar time: annual, monthly and daily series as lines, step lines, areas, columns and small multiples, with confidence bands, projections, shaded periods, event callouts, dual axes and direct end labels. These examples recreate editorial chart idioms (the Datawrapper reference set) with synthetic data and publication-style themes; every one of them is an ordinary Scatter2D, Line, Area, AreaLine, Bar, BarLine or Stacked configuration, so the same options apply to your own dated data.
<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>
// Use a data frame (2D-array) for the graph
var data =
// Create the configuration for the graph
var config = {
"graphType" : "Area",
"graphOrientation" : "vertical",
"theme" : "stata",
"xAxisGridMajorShow" : true,
"areaType" : "overlapping",
"xAxis" : [
"All years",
"Since 2010"
],
"colorScheme" : "User",
"colors" : [
"#C8CBCE",
"#1E81A0"
],
"objectColorTransparency" : 0.85,
"title" : "Most microbiome papers appeared since 2010",
"subtitle" : "Articles per year (synthetic)",
"smpTitle" : false,
"smpLabelInterval" : 5,
"smpTextRotate" : 90,
"xAxisTitle" : false,
"showLegend" : false,
"decorations" : {
"marker" : [
{
"text" : "83% of all\npapers",
"variable" : "Since 2010",
"sample" : "2022 ",
"type" : "text",
"x" : 0.88,
"y" : 0.7,
"color" : "rgb(255,255,255)"
}
]
},
"source" : "Synthetic data for illustration"
}
// 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>
<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" : {
"vars" : [
"All years",
"Since 2010"
],
"smps" : [
"1990 ",
"1991 ",
"1992 ",
"1993 ",
"1994 ",
"1995 ",
"1996 ",
"1997 ",
"1998 ",
"1999 ",
"2000 ",
"2001 ",
"2002 ",
"2003 ",
"2004 ",
"2005 ",
"2006 ",
"2007 ",
"2008 ",
"2009 ",
"2010 ",
"2011 ",
"2012 ",
"2013 ",
"2014 ",
"2015 ",
"2016 ",
"2017 ",
"2018 ",
"2019 ",
"2020 ",
"2021 ",
"2022 ",
"2023 ",
"2024 "
],
"data" : [
[
3.7,
6.8,
6.3,
7.3,
3,
4.8,
7.7,
7.2,
9.6,
7,
12.7,
12.1,
13.2,
11.9,
19.8,
19.8,
20.6,
20.7,
24.5,
27.3,
33.2,
43.5,
38.5,
53.1,
53.3,
63.1,
63.9,
69.8,
79.4,
86.6,
107.7,
118.5,
128.3,
137,
158.4
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
33.2,
43.5,
38.5,
53.1,
53.3,
63.1,
63.9,
69.8,
79.4,
86.6,
107.7,
118.5,
128.3,
137,
158.4
]
]
}
}
// Create the configuration for the graph
var config = {
"graphType" : "Area",
"graphOrientation" : "vertical",
"theme" : "stata",
"xAxisGridMajorShow" : true,
"areaType" : "overlapping",
"xAxis" : [
"All years",
"Since 2010"
],
"colorScheme" : "User",
"colors" : [
"#C8CBCE",
"#1E81A0"
],
"objectColorTransparency" : 0.85,
"title" : "Most microbiome papers appeared since 2010",
"subtitle" : "Articles per year (synthetic)",
"smpTitle" : false,
"smpLabelInterval" : 5,
"smpTextRotate" : 90,
"xAxisTitle" : false,
"showLegend" : false,
"decorations" : {
"marker" : [
{
"text" : "83% of all\npapers",
"variable" : "Since 2010",
"sample" : "2022 ",
"type" : "text",
"x" : 0.88,
"y" : 0.7,
"color" : "rgb(255,255,255)"
}
]
},
"source" : "Synthetic data for illustration"
}
// 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>
from canvasxpress.canvas import CanvasXpress
from canvasxpress.plot import show_in_browser
if __name__ == "__main__":
# Define the chart with its data and configuration
chart: CanvasXpress = CanvasXpress(
render_to = "timeseries12",
data = {
"y": {
"vars": ["All years", "Since 2010"],
"smps": ["1990 ", "1991 ", "1992 ", "1993 ", "1994 ", "1995 ", "1996 ", "1997 ", "1998 ", "1999 ", "2000 ", "2001 ", "2002 ", "2003 ", "2004 ", "2005 ", "2006 ", "2007 ", "2008 ", "2009 ", "2010 ", "2011 ", "2012 ", "2013 ", "2014 ", "2015 ", "2016 ", "2017 ", "2018 ", "2019 ", "2020 ", "2021 ", "2022 ", "2023 ", "2024 "],
"data": [
[3.7, 6.8, 6.3, 7.3, 3, 4.8, 7.7, 7.2, 9.6, 7, 12.7, 12.1, 13.2, 11.9, 19.8, 19.8, 20.6, 20.7, 24.5, 27.3, 33.2, 43.5, 38.5, 53.1, 53.3, 63.1, 63.9, 69.8, 79.4, 86.6, 107.7, 118.5, 128.3, 137, 158.4],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33.2, 43.5, 38.5, 53.1, 53.3, 63.1, 63.9, 69.8, 79.4, 86.6, 107.7, 118.5, 128.3, 137, 158.4]
]
}
},
config = {
"graphType": "Area",
"graphOrientation": "vertical",
"theme": "stata",
"xAxisGridMajorShow": True,
"areaType": "overlapping",
"xAxis": ["All years", "Since 2010"],
"colorScheme": "User",
"colors": ["#C8CBCE", "#1E81A0"],
"objectColorTransparency": 0.85,
"title": "Most microbiome papers appeared since 2010",
"subtitle": "Articles per year (synthetic)",
"smpTitle": False,
"smpLabelInterval": 5,
"smpTextRotate": 90,
"xAxisTitle": False,
"showLegend": False,
"decorations": {
"marker": [
{
"text": "83% of all\npapers",
"variable": "Since 2010",
"sample": "2022 ",
"type": "text",
"x": 0.88,
"y": 0.7,
"color": "rgb(255,255,255)"
}
]
},
"source": "Synthetic data for illustration"
},
width = 760,
height = 540
)
# Display the chart in its own Web page
show_in_browser(chart)
from canvasxpress.canvas import CanvasXpress
from canvasxpress.plot import graph
graph(
CanvasXpress(
render_to = "timeseries12",
data = {
"y": {
"vars": ["All years", "Since 2010"],
"smps": ["1990 ", "1991 ", "1992 ", "1993 ", "1994 ", "1995 ", "1996 ", "1997 ", "1998 ", "1999 ", "2000 ", "2001 ", "2002 ", "2003 ", "2004 ", "2005 ", "2006 ", "2007 ", "2008 ", "2009 ", "2010 ", "2011 ", "2012 ", "2013 ", "2014 ", "2015 ", "2016 ", "2017 ", "2018 ", "2019 ", "2020 ", "2021 ", "2022 ", "2023 ", "2024 "],
"data": [
[3.7, 6.8, 6.3, 7.3, 3, 4.8, 7.7, 7.2, 9.6, 7, 12.7, 12.1, 13.2, 11.9, 19.8, 19.8, 20.6, 20.7, 24.5, 27.3, 33.2, 43.5, 38.5, 53.1, 53.3, 63.1, 63.9, 69.8, 79.4, 86.6, 107.7, 118.5, 128.3, 137, 158.4],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33.2, 43.5, 38.5, 53.1, 53.3, 63.1, 63.9, 69.8, 79.4, 86.6, 107.7, 118.5, 128.3, 137, 158.4]
]
}
},
config = {
"graphType": "Area",
"graphOrientation": "vertical",
"theme": "stata",
"xAxisGridMajorShow": True,
"areaType": "overlapping",
"xAxis": ["All years", "Since 2010"],
"colorScheme": "User",
"colors": ["#C8CBCE", "#1E81A0"],
"objectColorTransparency": 0.85,
"title": "Most microbiome papers appeared since 2010",
"subtitle": "Articles per year (synthetic)",
"smpTitle": False,
"smpLabelInterval": 5,
"smpTextRotate": 90,
"xAxisTitle": False,
"showLegend": False,
"decorations": {
"marker": [
{
"text": "83% of all\npapers",
"variable": "Since 2010",
"sample": "2022 ",
"type": "text",
"x": 0.88,
"y": 0.7,
"color": "rgb(255,255,255)"
}
]
},
"source": "Synthetic data for illustration"
},
width = 760,
height = 540
)
)
using CanvasXpress
canvasxpress(Dict(
"y" => Dict(
"vars" => ["All years", "Since 2010"],
"smps" => ["1990 ", "1991 ", "1992 ", "1993 ", "1994 ", "1995 ", "1996 ", "1997 ", "1998 ", "1999 ", "2000 ", "2001 ", "2002 ", "2003 ", "2004 ", "2005 ", "2006 ", "2007 ", "2008 ", "2009 ", "2010 ", "2011 ", "2012 ", "2013 ", "2014 ", "2015 ", "2016 ", "2017 ", "2018 ", "2019 ", "2020 ", "2021 ", "2022 ", "2023 ", "2024 "],
"data" => [
[3.7, 6.8, 6.3, 7.3, 3, 4.8, 7.7, 7.2, 9.6, 7, 12.7, 12.1, 13.2, 11.9, 19.8, 19.8, 20.6, 20.7, 24.5, 27.3, 33.2, 43.5, 38.5, 53.1, 53.3, 63.1, 63.9, 69.8, 79.4, 86.6, 107.7, 118.5, 128.3, 137, 158.4],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33.2, 43.5, 38.5, 53.1, 53.3, 63.1, 63.9, 69.8, 79.4, 86.6, 107.7, 118.5, 128.3, 137, 158.4]
]
)
);
graphType = "Area",
graphOrientation = "vertical",
theme = "stata",
xAxisGridMajorShow = true,
areaType = "overlapping",
xAxis = ["All years", "Since 2010"],
colorScheme = "User",
colors = ["#C8CBCE", "#1E81A0"],
objectColorTransparency = 0.85,
title = "Most microbiome papers appeared since 2010",
subtitle = "Articles per year (synthetic)",
smpTitle = false,
smpLabelInterval = 5,
smpTextRotate = 90,
xAxisTitle = false,
showLegend = false,
decorations = Dict(
"marker" => [
Dict(
"text" => "83% of all\npapers",
"variable" => "Since 2010",
"sample" => "2022 ",
"type" => "text",
"x" => 0.88,
"y" => 0.7,
"color" => "rgb(255,255,255)"
)
]
),
source = "Synthetic data for illustration"
)
























