Search code examples
csvdygraphs

Can you ignore columns using dygraphs?


I basically have a large CSV file with 18 columns in it, but I don't need all that data for my chart. I just need 4 (the date, and three data values) and ignore the rest. Does dygraphs let me do this? Or do I need to find a different library?

I would rather not reparse the CSV file into smaller chunks because I would end up having to manage 20 different CSV files instead of just 4.


Solution

  • You can just load all of the values, then hide the data you don't want to see using the visibility option. http://dygraphs.com/options.html#visibility

    visibility
    Which series should initially be visible? Once the Dygraph has been constructed, you can access and modify the visibility of each series using the visibility and setVisibility methods.

    Type: Array of booleans Default: [true, true, ...]