Skip to content

Gif for CsvProvider Intro uses deprecated api that doesn't work. #1358

@nhirschey

Description

@nhirschey

The CsvProvider intro gif is nice, but the example at the top of the page using the yahoo finance api no longer works because the yahoo api changed. That's not good for a getting started intro.

  1. It would be possible to update the gif using the new yahoo URL scheme (see the FLIPS example).
  2. Or, we could replace it with something new like interest rates from the Federal Reserve.
#r "nuget: FSharp.Data"
#r "nuget: Plotly.NET, 2.0.0-beta5"

type Fred = CsvProvider<"https://fred.stlouisfed.org/graph/fredgraph.csv?id=GS10",
                         Schema="Date,Value">
let fredUrl series = $"https://fred.stlouisfed.org/graph/fredgraph.csv?id={series}"

["GS1", "1-Year"
 "GS10", "10-Year"]
|> Seq.map(fun (series, name) -> 
    Fred.Load(fredUrl series).Rows
    |> Seq.map(fun row -> row.DATE, row.Value)
    |> Chart.Line 
    |> Chart.withTraceName name)
|> Chart.Combine
|> Chart.withTitle "Treasury Constant Maturity Rates"
|> Chart.withY_AxisStyle(title = "Interest Rate (%)")
|> Chart.Show

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions