-
Notifications
You must be signed in to change notification settings - Fork 7
Items disappear when scrolling #2
Description
Just using the default values from the demo, if I add my own data, I get a strange effect where items will disappear from the graph when I scroll left to right. On the right side, they show all the items contained i na section like 1 year timespan. Say 2016 - 2017. As I scroll them to the left, the markers start to disappear steadily.
Here is my result, again, just scrolling from right to left, not zooming in or out, and taking screenshots along the way.
This is my array of data:
[{"timestamp":"2019-07-11","type":"milestone","devicename":"BrianAsh-W8","description":"Test description for a milestone 2","capex":null,"opex":null,"priority":null},{"timestamp":"2017-01-01","type":"milestone","devicename":"BrianAsh-W8","description":"This is a test milestone to see what happens","capex":null,"opex":null,"priority":null},{"timestamp":"2018-01-01","type":"milestone","devicename":"BrianAsh-W8","description":"This is ANOTHER test milestone to see what happens","capex":null,"opex":null,"priority":null},{"timestamp":"2019-01-01","type":"milestone","devicename":"BrianAsh-W8","description":"This is yet ANOTHER test milestone to see what happens","capex":null,"opex":null,"priority":null},{"timestamp":"2016-08-10","type":"risk","devicename":"BrianAsh-W8","description":"description","capex":"","opex":"","priority":"True"},{"timestamp":"2016-09-13","type":"reco","devicename":"BrianAsh-W8","description":"shows the tooltip plug-in being applied to the table after initialization.","capex":"","opex":"","priority":"True"},{"timestamp":"2016-09-06","type":"risk","devicename":"BrianAsh-W8","description":"Upgrade PC","capex":"$2,000","opex":"$3,000","priority":"True"},{"timestamp":"2016-10-04","type":"risk","devicename":"BrianAsh-W8","description":"Add another monitor","capex":"$300","opex":"$400","priority":"True"},{"timestamp":"2016-08-10","type":"risk","devicename":"CTSI - Switch Stack","description":"This method can be accomplished with either a Web Deploy package migration using the Inetmgr GUI, or the Web Deploy command line to copy the files and settings to the new server.","capex":"","opex":"","priority":"False"},{"timestamp":"2015-07-14","type":"reco","devicename":"CTSIDC1","description":"Unsupported OS","capex":"","opex":"","priority":"False"},{"timestamp":"2016-07-21","type":"reco","devicename":"NS1","description":"Replace hardware","capex":"","opex":"","priority":"True"},{"timestamp":"2016-07-21","type":"reco","devicename":"NS2","description":"Replace hardware","capex":"","opex":"","priority":"True"},{"timestamp":"2016-11-13","type":"milestone","devicename":"Updates-VMhost","description":"Warranty Expiration\n","capex":null,"opex":null,"priority":null}]};
This is the function altered to fit the new "type" I am using. NOTE: for the data property, "timelineData" is a variable that holds the json array above, converted to a regular array like your using.
$('.eventcontrol').EventControl({
onhover: function (item, element, event, inout) {
if (inout == 'out') {
$('.eventcontrol-target').html('');
element.css('color', element.data('clr'));
} else {
var x = ['', moment(item.timestamp).format('YYYY-MM-DD'), '' +
' ' + item.devicename + ' ' + item.description
];
$('.eventcontrol-target').html(x.join(''));
$('.eventcontrol-target').css('color', element.css('color'));
element.data('clr', element.css('color'));
element.css('color', '#9b59b6');
}
},
oncreate: function (item, element) {
if (item.type == 'risk') {
element.css('color', '#ae4242');
} else if (item.type == 'reco') {
element.css('color', '#bab804'); // yell = bab804 orng = e67e22
} else {
element.css('color', '#486c8b');
}
},
onclick: function (item, element, event) {
alert(item.timestamp);
},
data: timelineData, // An array of objects with a timestamp key.
hammertime: false, // Enable use of hammer.js to support touch devices
items_height: 135, // height in px of item/event area
markers_height: 31 // height in px of markers area
});
Im also trying to limit the whole time span to one year max, and 1 month min zoom. I dont need multiple years on the chart, just one year, but before I jump into that, I need to make sure this even works cause currently Im getting this strange issue above. Let me know if I can provide any more specific info.