Skip to content

F# combined with XPlot for graphing some payment transactions

Notifications You must be signed in to change notification settings

wilsoncg/PaymentCharts

Repository files navigation

About

Some F# code combined with Plotly for graphing some payment transactions.

#r "../packages/FSharp.Plotly.1.0.3/lib/net45/FSharp.Plotly.dll"
#r "../packages/SQLProvider.1.1.11/lib/FSharp.Data.SqlProvider.dll"
#r "../packages/FSharp.Configuration.1.3.0/lib/net45/FSharp.Configuration.dll"
#r "System.Data.Linq"

#load "ChartSettings.fs"
#load "Transactions.fs"

open FSharp.Plotly
open System.Web.UI.WebControls

let numDays = ChartSettings.numDays
let dc = ChartSettings.PaymentsDb.GetDataContext(ChartSettings.Settings.ConnectionStrings.PaymentsData, 300)

let daysChart = 
  Transactions.getDaysStacks numDays dc
  |> Seq.map (fun t -> Chart.StackedBar(t.Days, t.Amounts, Name= sprintf "%A" t.Name))
  |> Chart.Combine  
  |> Chart.withLayout (
    Layout.init (
        Barmode=StyleParam.Barmode.Stack, 
        Title= sprintf "Last %i days transactions" numDays))
  |> Chart.withSize (1200,900)
  |> Chart.SaveHtmlAs "last7days" 

Creates something like this: Last 7 days

About

F# combined with XPlot for graphing some payment transactions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published