HighCharts : Is it possible to customize the colors of individual series?

Options can be set separately for each series. var chart = new Highcharts.Chart({ chart: { renderTo: ‘container’ }, xAxis: { type: ‘datetime’ }, series: [{ name: ‘John’, color: ‘#0066FF’, dashStyle: ‘ShortDash’, data: [ [Date.UTC(2010, 0, 1), 29.9], [Date.UTC(2010, 2, 1), 71.5], [Date.UTC(2010, 3, 1), 106.4] ] },{ name: ‘Mary’, color: ‘#FF0000’, data: [ [Date.UTC(2010, 0, …

Read more

Fastest way to sort an array by timestamp

myList.sort(function(x, y){ return x.timestamp – y.timestamp; }) myList is a JavaScript array, which supports the sort method. This method accepts a function as argument, which sorts the array according to the returned value. Currently, the sort algorithm will place the element with the lowest timestamp first. Swap x.timestamp and y.timestamp if you want to sort …

Read more

Display a loading bar before the entire page is loaded

Use a div #overlay with your loading info / .gif that will cover all your page: <div id=”overlay”> <img src=”loading.gif” alt=”Loading” /> Loading… </div> jQuery: $(window).load(function(){ // PAGE IS FULLY LOADED // FADE OUT YOUR OVERLAYING DIV $(‘#overlay’).fadeOut(); }); Here’s an example with a Loading bar: jsBin demo ;(function(){ function id(v){ return document.getElementById(v); } function …

Read more

Service worker is caching files but fetch event is never fired

After looking at your gist and your question, I think your issue is with scoping. From what I’ve determined with service workers(at least with static files), the service worker only has a maximum scope of the directory it is in. That is to say, it can’t load files/requests/responses that are pulled from a location at …

Read more