diff --git a/types/dygraphs/index.d.ts b/types/dygraphs/index.d.ts index e1bcf1e633..3e2c02d9df 100644 --- a/types/dygraphs/index.d.ts +++ b/types/dygraphs/index.d.ts @@ -1284,6 +1284,16 @@ declare class Dygraph { */ indexFromSetName(name: string): number; + /** + * Find the row number corresponding to the given x-value. + * Returns null if there is no such x-value in the data. + * If there are multiple rows with the same x-value, this will return the + * first one. + * @param xVal The x-value to look for (e.g. millis since epoch). + * @return The row number, which you can pass to getValue(), or null. + */ + getRowForX(xVal: number): number | null; + /** * Trigger a callback when the dygraph has drawn itself and is ready to be * manipulated. This is primarily useful when dygraphs has to do an XHR for the