Reputation: 1
For days I've searched through Dygraph and the rest of the web trying to solve this problem. I’m working with data recorded over several months at 20 minute intervals. Example below:
function data_tempnew() {
return "" +
"Date,VWC,TEMP\n" +
"20130510 14:00,0.25;0.24;0.35,20.5;21.1;20.1\n" +
. . .
"20130930 15:40,0.26;0.23;0.30,19.1;18.8;18.5\n" +
;
}
Using the following HTML:
<script type="text/javascript">
g1 = new Dygraph(
document.getElementById("noroll"),
data_tempnew,
{
rollperiod: 14,
series:{"VWC":{axis:'y2'},},
customBars: false,
title: 'Logged Average Soil Temperature and Volumetric Water Content ',
ylabel: 'Temperature (C)',
y2label: 'Volumetric Water Content',
legend: 'always',
labelsDivStyles: { 'textAlign': 'right' }
}
);
I get an undesirable result where only the midnight data points are posted with flat lines connecting each 24 hour point. Kind of looks like a staircase with spikes. All the resolution and detail vanishes.
However, when the data is entered as :
<script type="text/javascript">
g1 = new Dygraph(
document.getElementById("noroll"),
“datatemp.csv”,
{ . . .
I get the result I want, lots of resolution, smooth transitions and loads of detail. BUT the figure will no longer render in IE. Also, there appears to be a record limitation on the amount of data when using javascript. What to do here? I need the fine resolution data and to have the figure render in IE. I'm an experienced researcher but 'cut and paste' amateur coder. I hope you can help.
Upvotes: 0
Views: 2371
Reputation: 2131
I suspect this is a JavaScript date/time string parsing issue: in the first example the time part of the x-data string is being ignored, only the date part is being parsed. Is the text format in your CSV file exactly the same as the text in the first example? (and use a text editor, not Excel, to look at the CSV file!)
I understand Dygraphs includes its own date/time parsing routines, but which parser is being used in which case, I am not sure. But @danvk will know!
Upvotes: 1