Add an interactive time-series line chart to a dashboard page by passing an array of date-value pairs and pointing at a container element.
Display a donut chart showing category breakdowns with selectable segments and hover labels using a simple data array.
Update a live chart with new data after the page loads by calling setData without rebuilding the chart from scratch.
Show a stacked bar chart with multiple data series and configurable axis labels on any page that already uses jQuery.
Requires jQuery and Raphael.js as dependencies, the project has had no release since June 2014 and is no longer actively maintained.
Morris.js is a JavaScript library for drawing charts on web pages. It handles four chart types: line charts, bar charts, area charts, and donut charts. The project was built with time-series data in mind, so its line charts are well suited to plotting values over time, with x-axis labels that understand date and time formats automatically. The API is designed to be simple. You point it at a container element on your page, pass in an array of data, and specify which fields to use for the x and y axes. From there the library draws the chart. Charts can be updated after creation with a setData method, which lets you refresh the data without rebuilding the whole chart from scratch. To use Morris.js, you need jQuery and Raphael.js, a vector graphics library that handles the actual drawing. Morris.js builds on top of Raphael to produce its rendered output. Charts are interactive out of the box, showing hover tooltips with data values when the user moves the mouse over data points. Features added over several years of development include stacked bar charts, donut charts with selectable segments, automatic chart resizing when the browser window changes size, range selection on time-series charts, support for marking specific events or goal lines on a chart, and configurable axis labels including diagonal label angles. You can also supply custom formatting functions for labels and hover content. The maintainer has stated that the project is no longer actively supported, and no release has been made since June 2014. The code is available and functional, but bug fixes and new features are not being added.
← morrisjs on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.