pick only specific headers from CSV

38 views
Skip to first unread message

Ilias

unread,
Dec 20, 2017, 7:09:33 AM12/20/17
to dygraphs-users
i have a csv which is being generated by jmeter and has various stuff in it. But i really want to parse specific headers with Dygraphs. Can I do that ? I've seen that you can specify the headers with the labels option however it doesn't stop dygraphs from parsing the entire csv which is causing issues since it finds string values which it cannot process as numbers to graph them.

MMM PPP

unread,
Dec 26, 2017, 7:15:09 AM12/26/17
to dygraphs-users
Mmmm, dygraphs treats every column of data as a new series to display on the graph. You can tell it which series it should display and which it shouldn't. Is that what you mean?

If this is what you meant, it's quite easy, you just use the "visibility" option when you create your graph and tell whether each series is visible or not. Something like this:

    MyGraph = new Dygraph(
      document
.getElementById("graphdiv"),
     
"file.txt", // path to CSV file
     
{
        visibility
: [false, false, true, false, false],
        labels
: [ "Date", "Series 1", "Series 2", "Series 3", "Series 4", "Series 5" ],
        colors
: [ "black", "yellow", "red", 'green', "blue" ]
     
}
   
);



El dimecres, 20 desembre de 2017 13:09:33 UTC+1, Ilias va escriure:
Reply all
Reply to author
Forward
0 new messages