function generateTimelineGraph(data)
    nameData = {data.display};
    srcNames = {data.source_name};
    % Data for X-Axis
    timeData = [data.start_time_point; data.start_time_point; 
                data.stop_time_point; data.stop_time_point];

    % Re-baseline timing information.
    minStart = min(timeData(1,:));
    timeData = timeData - minStart;

    % Asign index to unique names.
    % This is done to group identical events.
    indx = [];
    nameMap = containers.Map;
    cnt = 0;
    labelName = {};
    for i= 1:length(nameData)
        if(~isKey(nameMap, nameData{i}))
            cnt = cnt + 1;
            nameMap(nameData{i}) = cnt;
            labelName = [labelName nameData{i}];
        end
        indx(i) = nameMap(nameData{i});
    end
    
    % Thickness of the polygon. 0.8 around indx leaving 0.2 units of space
    % between two polygons.
    % Data for Y_Axis
    vData = [indx-0.4; indx+0.4; indx+0.4; indx-0.4];
    
    % - Combine all the polygon coordinates in one matrix.
    % - introduced NaN to seperate the polygons.
    % - The plots are done for one source at a time to get
    % different colors.
    fig = figure;
    hold on
    for s = unique(srcNames)
        fltr = strcmp(s,srcNames);
        nameDataFiltered = nameData(fltr);
        timeDataFiltered = timeData(:,fltr);
        vDataFiltered = vData(:,fltr);
        X = timeDataFiltered(:,1)';
        Y = vDataFiltered(:,1)';
        for i= 2:length(nameDataFiltered)
            X = [X NaN timeDataFiltered(:,i)'];
            Y = [Y NaN vDataFiltered(:,i)'];
        end
        plot(polyshape(X,Y,'Simplify', false));
    end
    hold off
    
    grid on;
    set(gca,'TickLabelInterpreter', 'none');
    ax = gca;
    ax.YTick = 1:cnt;
    ax.YTickLabel = labelName;
    dcm_obj = datacursormode(fig);
    set(dcm_obj,'UpdateFcn',{@dataCursorUpdateFcn,labelName})
    
end

function txt = dataCursorUpdateFcn(~,event_obj,labelName)
% Customizes text of data tips

    pos = get(event_obj,'Position');
    eventName = labelName(round(pos(2)));
    txt = {['Time: ',num2str(pos(1))],...
          ['Event: ',eventName{1}]};%,...
          %['Duration: ',num2str(timeData(3,round(pos(2))) - timeData(1,round(pos(2))))]};
end