DocOps Charts
1. DocOps Bar Charts
1.1. Introduction
The DocOps Bar Chart Extension allows you to create visually appealing bar charts in your AsciiDoctor documents. Bar charts are useful for comparing data across categories and visualizing trends over time.
This guide will help you understand the basic concepts of bar charts, how to include them in your AsciiDoctor documents, and provide examples of different types of bar charts.
1.2. Basic Concepts
1.2.1. What are Bar Charts?
Bar charts in the DocOps extension are SVG-based graphical elements that can be included in your AsciiDoctor documents. Each bar chart has:
-
A title (the main heading of the chart)
-
X and Y axis labels
-
A series of data points (bars)
-
Optional display settings for customizing the appearance
The extension supports two main types of bar charts:
-
Regular Bar Charts - For comparing individual data points
-
Grouped Bar Charts - For comparing multiple data series across categories
Each type can be displayed in various styles, including:
-
Horizontal bars
-
Vertical bars
-
Cylinder-style bars
-
Dark mode charts
1.3. AsciiDoctor Syntax for Bar Charts
To include bar charts in your AsciiDoctor document, you use a special macro syntax. Here’s the basic format:
[docops,bar]
----
title=Chart Title
yLabel=Y-Axis Label
xLabel=X-Axis Label
baseColor=#4361ee
vBar=false
useDark=false
type=R
---
Category 1 | 120.0
Category 2 | 334.0
// More data points...
----
For grouped bar charts, use the following format:
[docops,bargroup]
----
title=Chart Title
yLabel=Y-Axis Label
xLabel=X-Axis Label
baseColor=#D988B9
vBar=false
condensed=false
useDark=false
---
Group 1 | Category 1 | 5000.0
Group 1 | Category 2 | 7000.0
// More data points...
Group 2 | Category 1 | 6000.0
Group 2 | Category 2 | 8000.0
// More data points...
// More groups...
----
The macro processes the configuration and data and generates an SVG representation of the bar chart that is embedded in your document.
1.3.1. Regular Bar Chart Properties
Configuration Properties
-
title
(required): The main heading of the chart -
yLabel
(optional): The label for the Y-axis -
xLabel
(optional): The label for the X-axis -
baseColor
(optional): The base color for the bars (default: "#FE7A36") -
type
(optional): The style of the bars ("R" for regular, "C" for cylinder) -
vBar
(optional): Whether to display vertical bars (default: false) -
useDark
(optional): Whether to use dark mode (default: false) -
sorted
(optional): Whether to sort the bars by value (default: false) -
scale
(optional): A scaling factor for the chart (default: 1.0)
Data Format
After the configuration section and the separator line (---
), each line represents a data point with the following format:
Label | Value [| Color]
-
Label
(required): The category label for the data point -
Value
(required): The numerical value for the data point -
Color
(optional): A custom color for this specific data point
1.3.2. Grouped Bar Chart Properties
Configuration Properties
-
title
(required): The main heading of the chart -
yLabel
(optional): The label for the Y-axis -
xLabel
(optional): The label for the X-axis -
baseColor
(optional): The base color for the chart (default: "#D988B9") -
lineColor
(optional): The color for grid lines (default: "#FFBB5C") -
vBar
(optional): Whether to display vertical bars (default: false) -
condensed
(optional): Whether to use condensed mode (default: false) -
useDark
(optional): Whether to use dark mode (default: false) -
scale
(optional): A scaling factor for the chart (default: 1.0)
Data Format
After the configuration section and the separator line (---
), each line represents a data point with the following format:
Group | Label | Value [| Color]
-
Group
(required): The name of the group -
Label
(required): The category label for the data point -
Value
(required): The numerical value for the data point -
Color
(optional): A custom color for this specific data point
1.4. Examples
1.4.1. Basic Bar Chart Example
Here’s a simple example of a horizontal bar chart:
[docops,bar]
----
title=Monthly Sales Performance
yLabel=Revenue ($)
xLabel=Month
baseColor=#4cc9f0
type=R
---
January | 120.0
February | 334.0
March | 455.0
April | 244.0
May | 256.0
June | 223.0
----
1.4.2. Vertical Bar Chart Example
You can create vertical bar charts by setting the vBar
property to true
:
[docops,bar]
----
title=Berry Picking by Month 2024
yLabel=Number of Sales
xLabel=Month
baseColor=#4361ee
vBar=true
---
Jan | 120.0
Feb | 334.0
Mar | 455.0
Apr | 244.0
May | 256.0
Jun | 223.0
----
1.4.3. Cylinder-Style Bar Chart Example
You can create cylinder-style bar charts by setting the type
property to "C"
:
[docops,bar]
----
title=Quarterly Performance
yLabel=Revenue ($)
xLabel=Quarter
baseColor=#f72585
type=C
---
Q1 | 320.0
Q2 | 480.0
Q3 | 290.0
Q4 | 410.0
----
1.4.4. Dark Mode Bar Chart Example
You can create dark mode bar charts by setting the useDark
property to true
:
[docops,bar]
----
title=Monthly Sales Performance (Dark Mode)
yLabel=Revenue ($)
xLabel=Month
baseColor=#4cc9f0
useDark=true
type=R
---
January | 120.0
February | 334.0
March | 455.0
April | 244.0
May | 256.0
June | 223.0
----
1.4.5. Grouped Bar Chart Example
Here’s an example of a grouped bar chart:
[docops,bargroup]
----
title=Annual Product Sales Report
yLabel=Sales (USD)
xLabel=Quarters
lineColor=#921A40
baseColor=#F3EDED
---
Product A | Q1 | 5000.0
Product A | Q2 | 7000.0
Product A | Q3 | 8000.0
Product A | Q4 | 6000.0
Product B | Q1 | 6000.0
Product B | Q2 | 8000.0
Product B | Q3 | 7000.0
Product B | Q4 | 9000.0
----
1.4.6. Vertical Grouped Bar Chart Example
You can create vertical grouped bar charts by setting the vBar
property to true
:
[docops,bargroup]
----
title=Annual Product Sales Report
yLabel=Sales (USD)
xLabel=Quarters
lineColor=#921A40
baseColor=#F3EDED
vBar=true
---
Product A | Q1 | 5000.0
Product A | Q2 | 7000.0
Product A | Q3 | 8000.0
Product A | Q4 | 6000.0
Product B | Q1 | 6000.0
Product B | Q2 | 8000.0
Product B | Q3 | 7000.0
Product B | Q4 | 9000.0
----
1.4.7. Condensed Grouped Bar Chart Example
You can create condensed grouped bar charts by setting the condensed
property to true
:
[docops,bargroup]
----
title=Annual Product Sales Report
yLabel=Sales (USD)
xLabel=Quarters
lineColor=#921A40
baseColor=#F3EDED
condensed=true
---
Product A | Q1 | 5000.0
Product A | Q2 | 7000.0
Product A | Q3 | 8000.0
Product A | Q4 | 6000.0
Product B | Q1 | 6000.0
Product B | Q2 | 8000.0
Product B | Q3 | 7000.0
Product B | Q4 | 9000.0
----
1.5. Conclusion
The DocOps Bar Chart Extension provides a powerful way to enhance your AsciiDoctor documents with visually appealing bar charts. By using the simple key-value configuration format and pipe-separated data, you can create customized charts that match your document’s style and purpose.
The extension supports both regular and grouped bar charts, with various display options including horizontal/vertical orientation, cylinder style, dark mode, and condensed mode for grouped charts.
2. DocOps Line Charts
2.1. Introduction
The DocOps Line Chart Extension allows you to create visually appealing line charts in your AsciiDoctor documents. Line charts are useful for visualizing trends over time, comparing multiple data series, and identifying patterns in your data.
This guide will help you understand the basic concepts of line charts, how to include them in your AsciiDoctor documents, and provide examples of different types of line charts.
2.2. Basic Concepts
2.2.1. What are Line Charts?
Line charts in the DocOps extension are SVG-based graphical elements that can be included in your AsciiDoctor documents. Each line chart has:
-
A title (the main heading of the chart)
-
One or more data series (lines)
-
Data points for each series
-
X-axis labels (typically time periods)
-
Y-axis values
-
Optional display settings for customizing the appearance
The extension supports various styles of line charts, including:
-
Multiple data series on a single chart
-
Smooth curved lines or straight line segments
-
Interactive tooltips on hover
-
Customizable colors and backgrounds
-
Dark mode support for better visibility in dark-themed documents
2.3. AsciiDoctor Syntax for Line Charts
To include line charts in your AsciiDoctor document, you use a special macro syntax. The DocOps extension now supports a simpler tabular format for line charts:
[docops,line]
----
title=Chart Title
width=900
darkMode=false
---
Series 1 | Jan | 40
Series 1 | Feb | 70
Series 1 | Mar | 90
Series 2 | Jan | 22
Series 2 | Feb | 33
Series 2 | Mar | 44
----
The macro processes this tabular data and generates an SVG representation of the line chart that is embedded in your document.
2.3.1. Line Chart Configuration
The configuration parameters are specified at the beginning of the content, followed by a separator line (---
), and then the actual chart data.
Configuration Parameters
-
title
(optional): The main heading of the chart (default: "Line Chart") -
width
(optional): The width of the chart in pixels (default: 500) -
height
(optional): The height of the chart in pixels (default: 500) -
legend
(optional): Whether to display a legend (default: true) -
hover
(optional): Whether to enable hover effects (default: true) -
smooth
(optional): Whether to display smooth curved lines (true) or straight line segments (false) (default: true) -
points
(optional): Whether to display data points (default: true) -
grid
(optional): Whether to display grid lines (default: true) -
xAxisLabel
(optional): Label for the x-axis -
yAxisLabel
(optional): Label for the y-axis -
darkMode
(optional): Whether to use dark mode styling (default: false) -
colors
(optional): A comma-separated list of custom colors for the chart
2.4. Examples
2.4.1. Basic Line Chart Example
Here’s a simple example of a line chart with multiple data series using the new tabular format:
[docops,line]
----
title=Monthly Performance Metrics
width=800
---
Sales | Jan | 40
Sales | Feb | 70
Sales | Mar | 90
Sales | Apr | 70
Sales | May | 40
Sales | Jun | 30
Marketing | Jan | 22
Marketing | Feb | 33
Marketing | Mar | 44
Marketing | Apr | 55
Marketing | May | 66
Marketing | Jun | 77
----
2.4.2. Multi-Series Line Chart Example
Here’s an example of a line chart with three data series:
[docops,line]
----
title=Department Performance Metrics
width=900
smooth=true
---
Sales | Jan | 40
Sales | Feb | 70
Sales | Mar | 90
Sales | Apr | 70
Sales | May | 40
Sales | Jun | 30
Sales | Jul | 60
Sales | Aug | 90
Sales | Sept | 70
Marketing | Jan | 22
Marketing | Feb | 33
Marketing | Mar | 44
Marketing | Apr | 55
Marketing | May | 66
Marketing | Jun | 77
Marketing | Jul | 88
Marketing | Aug | 109
Marketing | Sept | 110
Development | Jan | 56
Development | Feb | 65
Development | Mar | 78
Development | Apr | 72
Development | May | 56
Development | Jun | 94
Development | Jul | 86
Development | Aug | 73
Development | Sept | 70
----
2.4.3. Product Segment Performance Example
This example shows performance data for different product segments over a year:
[docops,line, role=left, name=seg]
----
title=Product Segment Performance
width=900
darkMode=false
---
Affordable Segment | Jan | 173
Affordable Segment | Feb | 153
Affordable Segment | Mar | 195
Affordable Segment | Apr | 147
Affordable Segment | May | 120
Affordable Segment | Jun | 144
Affordable Segment | Jul | 148
Affordable Segment | Aug | 109
Affordable Segment | Sept | 174
Affordable Segment | Oct | 130
Affordable Segment | Nov | 172
Affordable Segment | Dec | 132
Luxury Segment | Jan | 189
Luxury Segment | Feb | 189
Luxury Segment | Mar | 105
Luxury Segment | Apr | 112
Luxury Segment | May | 173
Luxury Segment | Jun | 109
Luxury Segment | Jul | 151
Luxury Segment | Aug | 197
Luxury Segment | Sept | 174
Luxury Segment | Oct | 145
Luxury Segment | Nov | 177
Luxury Segment | Dec | 167
Super Luxury Segment | Jan | 185
Super Luxury Segment | Feb | 185
Super Luxury Segment | Mar | 126
Super Luxury Segment | Apr | 134
Super Luxury Segment | May | 196
Super Luxury Segment | Jun | 153
Super Luxury Segment | Jul | 112
Super Luxury Segment | Aug | 133
Super Luxury Segment | Sept | 200
Super Luxury Segment | Oct | 145
Super Luxury Segment | Nov | 167
Super Luxury Segment | Dec | 110
----
2.4.4. Dark Mode Line Chart Example
You can enable dark mode for better visibility in dark-themed documents:
[docops,line]
----
title=Series Comparison
width=800
darkMode=true
---
Series A | 1 | 10
Series A | 2 | 15
Series A | 3 | 13
Series A | 4 | 17
Series A | 5 | 20
Series B | 1 | 5
Series B | 2 | 7
Series B | 3 | 10
Series B | 4 | 12
Series B | 5 | 15
----
2.4.5. Custom Colors Example
You can specify custom colors for your line chart:
[docops,line]
----
title=Quarterly Performance
width=800
colors=#6a0dad,#0da6a0,#daad0d
---
Q1 2023 | Jan | 120
Q1 2023 | Feb | 150
Q1 2023 | Mar | 180
Q2 2023 | Apr | 140
Q2 2023 | May | 170
Q2 2023 | Jun | 200
Q3 2023 | Jul | 160
Q3 2023 | Aug | 190
Q3 2023 | Sep | 220
----
2.5. Interactive Features
Line charts in the DocOps extension include several interactive features:
-
Tooltips: Hover over data points to see detailed information
-
Legend Highlighting: Hover over legend items to highlight them
-
Visual Effects: Data points have hover effects for better visibility
These interactive features enhance the user experience and make it easier to interpret the data in your charts.
2.6. Conclusion
The DocOps Line Chart Extension provides a powerful way to enhance your AsciiDoctor documents with visually appealing line charts. The new tabular data format makes it easier to create and maintain line charts compared to the previous JSON format.
The extension supports multiple data series, smooth or straight lines, interactive features, and dark mode, giving you flexibility in how you present your time-series data. The dark mode support is particularly useful for documents that are viewed in low-light environments or for users who prefer dark-themed interfaces.
3. DocOps Pie Charts
3.1. Introduction
The DocOps Pie Chart Extension allows you to create visually appealing pie charts in your AsciiDoctor documents. Pie charts are useful for showing the proportion of different categories within a whole and comparing relative sizes of data.
This guide will help you understand the basic concepts of pie charts, how to include them in your AsciiDoctor documents, and provide examples of different types of pie charts.
3.2. Basic Concepts
3.2.1. What are Pie Charts?
Pie charts in the DocOps extension are SVG-based graphical elements that can be included in your AsciiDoctor documents. Each pie chart has:
-
A title (the main heading of the chart)
-
A series of slices, each representing a proportion of the whole
-
Labels for each slice
-
Optional display settings for customizing the appearance
The extension supports two main types of pie charts:
-
Regular Pie Charts - A traditional circular chart divided into slices
-
Donut Charts - Similar to pie charts but with a hole in the center
Each type can be displayed in various styles, including:
-
Custom colors for slices
-
Interactive hover effects
-
Percentage labels
-
Dark mode support for better visibility in dark-themed documents
3.3. AsciiDoctor Syntax for Pie Charts
To include pie charts in your AsciiDoctor document, you use a special macro syntax. Here’s the basic format:
[docops,pieslice]
----
Product A | 30
Product B | 25
Product C | 20
Product D | 15
Product E | 10
----
For more customization, you can add configuration parameters:
[docops,pieslice]
----
title=Sales Distribution by Product
width=600
height=400
legend=true
percentages=true
donut=false
---
Product A | 30
Product B | 25
Product C | 20
Product D | 15
Product E | 10
----
The macro processes the configuration and data to generate an SVG representation of the pie chart that is embedded in your document.
3.3.1. Configuration Parameters
The following configuration parameters are available:
-
title
(optional): The main heading of the chart (default: "Pie Chart") -
width
(optional): The width of the chart in pixels (default: 500) -
height
(optional): The height of the chart in pixels (default: 500) -
legend
(optional): Whether to display a legend (default: true) -
percentages
(optional): Whether to display percentage values (default: true) -
hover
(optional): Whether to enable hover effects (default: true) -
donut
(optional): Whether to display as a donut chart (default: false) -
colors
(optional): A comma-separated list of custom colors for the chart -
darkMode
(optional): Whether to use dark mode styling (default: false)
3.3.2. Data Format
The data for the pie chart is specified in a simple format:
Label | Value [| Color]
Where:
* Label
is the category name
* Value
is the numerical value for the slice
* Color
(optional) is a custom color for this specific slice (e.g., #ff5733)
If you include configuration parameters, you must separate them from the data with a line containing three dashes (---
).
3.4. Examples
3.4.1. Basic Pie Chart Example
Here’s a simple example of a pie chart with minimal configuration:
[docops,pieslice]
----
Product A | 30
Product B | 25
Product C | 20
Product D | 15
Product E | 10
----
3.4.2. Pie Chart with Configuration
Here’s an example with configuration parameters:
[docops,pieslice]
----
title=Sales Distribution by Product
width=600
height=400
legend=true
percentages=true
donut=false
---
Product A | 30
Product B | 25
Product C | 20
Product D | 15
Product E | 10
----
3.4.3. Pie Chart with Positioning
You can position your chart using the role
attribute:
.Pie Chart
[docops,pieslice, role=left]
----
title=Favorite Anime
width=600
height=400
legend=true
percentages=true
donut=false
---
Naruto | 16.0
Bleach | 4.0
One Piece | 9.0
One Punch Man | 7.0
My Hero Academia | 6.0
Demon Slayer | 10.0
----
3.4.4. Donut Chart Example
You can create donut charts by setting the donut
parameter to true
:
.Pie Chart
[docops,pieslice, role=left]
----
title=Favorite Anime
width=600
height=400
legend=true
percentages=true
donut=true
---
Naruto | 16.0
Bleach | 4.0
One Piece | 9.0
One Punch Man | 7.0
My Hero Academia | 6.0
Demon Slayer | 10.0
----
3.4.5. Custom Colors for Individual Slices
You can specify custom colors for individual slices:
[docops,pieslice, title="Sales Distribution with Custom Colors"]
----
Product A | 30 | #ff5733
Product B | 25 | #33ff57
Product C | 20 | #3357ff
Product D | 15 | #f3ff33
Product E | 10 | #ff33f3
----
3.5. Interactive Features
Pie charts in the DocOps extension include several interactive features:
-
Hover Effects: Pie slices have hover effects for better visibility
-
Tooltips: Hover over slices to see detailed information
-
Legend Interaction: Hovering over legend items highlights the corresponding slice
These interactive features enhance the user experience and make it easier to interpret the data in your charts.
3.6. Conclusion
The DocOps Pie Chart Extension provides a powerful way to enhance your AsciiDoctor documents with visually appealing pie charts. By using the simple pipe-separated format and configuration parameters, you can create customized charts that match your document’s style and purpose.
The extension supports both regular pie charts and donut charts, with various display options including custom colors, interactive features, and dark mode. The dark mode support is particularly useful for documents that are viewed in low-light environments or for users who prefer dark-themed interfaces.