-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
Suggestions: Provide support (likely through a third-party plugin) to add basic charts (e.g., bar/line/pie ... charts) using text sources (or csv files), similar to how we support basic UML diagrams.
(Updating the description to include the TODO from the attempt in #2052
- Add optional mermaid plugin for alternative diagram & chart support
(Updating the description to include conclusions/TODOs from the discussions below, see #1663 (comment))
- Include documentation/examples on how it is possible to utilize some of these charting libraries
- Extract out a few common chart types with minimalistic options to allow for really simple use cases.
- E.g. a way to create a piechart by doing something like
<pie-chart>data = [1,2,3]</pie-chart>. - The user need not know what is the underlying charting library in use, and the user is limited in terms of the options provided.
- E.g. a way to create a piechart by doing something like
- Create a general abstraction to simplify the typical steps required
Elaboration on the last point:
- import (help import the script according to the type defined)
- define a location to place the chart (user define the data/option right here, or pass in from an external file via data attribute)
- init with a data/option object (help pass the data/option and generate the required script to append to the page)
Example syntax:
<chart type="chartjs">
{
type: 'bar',
data: {
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
}
</chart>
<chart type="chartjs" data="/chart2.json"></chart>