É um gráfico de visualização interativa para visualizar eventos no tempo.
$render[0]='alerta';
$query = "SELECT * FROM evento_data WHERE id_evento='".$_POST['timeline_eventId']."'";
$result = $pdo->query($query);
$linha = $result->fetch(PDO::FETCH_ASSOC);
$resposta='
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-detail="data-detail" data-severity="all,error" data-redisplay="true"></span>
<script id="alerta_s" type="text/javascript">
DinarteCoelho.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 6000
, escape: true
, keepAlive: false
, msgs: [{
summary: "Evento Selecionado"
, detail: "'.$linha['content_evento'].'"
, severity: "info"
, severityText: "Information"
}]
});
</script>
';
dc.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 6000
, escape: true
, keepAlive: false
, msgs: []
});
dc.cw("Timeline", "widget_timeline", {
id: "timeline"
, data: [
<?php
$query = "SELECT * FROM evento_data";
$result = $pdo->query($query);
$cont = $result->RowCount();
$i=1;
while ($linha = $result->fetch(PDO::FETCH_ASSOC)){
$start=explode(' ',$linha['start']);
$start=$start[0].'T'.$start[1];
?>
{
id: "<?php echo $linha['id_evento'];?>"
, start: new Date('<?php echo $start;?>')
, end: null
, group: null
, className: null
, content: "<?php echo $linha['content_evento']?>"
}
<?php
if($cont>$i){echo ',';}$i++;}
?>
]
, currentTime: new Date('2021-11-11T17:51:57.226+01:00')
, preloadFactor: 0.0
, opts: {
autoResize: true
, height: "250px"
, width: "100%"
, orientation: {
axis: 'bottom'
, item: 'bottom'
}
, editable: {
add: false
, remove: false
, updateTime: false
, updateGroup: false
, overrideItems: false
}
, selectable: true
, zoomable: true
, moveable: true
, zoomMin: 10
, zoomMax: 315360000000000
, margin: {
axis: 10
, item: {
horizontal: 10
, vertical: 10
}
}
, type: "box"
, groupOrder: "content"
, stack: true
, showCurrentTime: true
, showMajorLabels: true
, showMinorLabels: true
, locale: "pt_BR"
, clickToUse: false
, showTooltips: true
, tooltip: {
followMouse: false
, overflowMethod: 'flip'
, delay: 500
}
}
, behaviors: {
select: function (ext, event) {
dc.ab({
s: "timeline"
, e: "select"
, f: "formulario"
, p: "timeline"
}, ext);
}
}
});