See the Dygraphs docs: http://dygraphs.com/data.html. It states:
xValueParser affects CSV only
Updating your code to use CSV works:
g = new Dygraph(
// containing div
document.getElementById("graphdiv"),
"Date,Series1,Series2\n" +
"1247382000,50,20\n" +
"1247986800,50,10\n",
// options
{
xRangePad: 10,
yRangePad: 10,
xValueFormatter: Dygraph.dateString_,
xValueParser: function (x) {
return 1000 * parseInt(x, 10);
},
xTicker: Dygraph.dateTicker,
labels: ["Dates", "Not Kept", "Hosts"],
title: "Promises not kept",
legend: "always",
drawPoints: "true",
pointSize: 2,
colors: ["orange", "blue", "black"],
strokeWidth: 1
});
Here is your updated FIDDLE