Why manyamPlotlyTimeline exists -
- Plotly which is awesome in itself hasn't yet developed a timeline view but provides great interactivity such as zoom, tootlips, chart download and much more. Refer plotly for more information.
- Creating a new timeline takes effort and is time consuming.
Download the zip file from GitHub and include it in your project.
Refer index.html and refer all the required files into your HTML file. Do not forget to include plotly!
<div id='timelinePlot'></div>
var timeline = new ManyamPlotlyTimeline('timelinePlot');
data = [
{
"start_time": "2018-06-13",
"end_time": "2017-07-20",
"event": "Hydroxyzine Hydrochloride"
},
{
"start_time": "2016-07-04",
"end_time": "2018-03-22",
"event": "AcneFree Severe Maximum Strength Repair Lotion"
}]
var params = {
data: data,
startTimeKey: 'start_time',
endTimeKey: 'end_time',
labelKey: 'event',
toolTipKeys: ['start_time', 'end_time', 'event']
};
timeline.generateTimelinePlot(params);
That's it!