We are pleased to announce Carbon Graphs as an open source code project!
We did an extensive audit of various Cerner solutions already available, the graph types they were using, and the libraries used to plot the data. We discovered that most solutions had graph implementations baked into their product such that they were modifying or extending open source libraries in an effort to support Cerner’s unique clinical and accessibility needs. These implementations, however, could not be broadly reused. As such, we saw an opportunity to collaborate with our User Experience team to create an attractive, modern, and flexible graphing solution that not only would meet Cerner’s design standards, but that could be open sourced to give back to the engineering community for their own graphing needs.
With Carbon, you get:
- Line graph
- Multiline graph
- Spline Line graph
- Non-Contiguous Line graph
- Paired Result graph
- Timeline graph
- Bar graph
- Pie chart
- Gantt chart
Graphs come with following settings that be customized:
- Grid lines (Vertical and Horizontal)
- Axes (X and Y, or Y2)
- Regions (Horizontal only)
Carbon also supports functionalities that are not provided with popular open source libraries such as:
- Support for custom SVG shapes as data points
- Support for different standard shapes (dark or light) as data points
- Locale support for axes ticks
Drawing a Line Graph
Let’s see how easy it can be to get started!
To create a line graph, first create an HTML element that will hold the graph. Here, we are specifying a main element with an id of root.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Next, we’ll configure the dataset we want to plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
And to wrap it all up, we’ll call loadContent to draw the content.
We are continuously working on improving Carbon to support our ever-increasing clinical needs! Help us make it better by reporting issues using the GitHub issues queue or feel free to contribute with pull requests.