Git Product home page Git Product logo

xplot's People

Contributors

antoniobarros avatar benjol avatar cartermp avatar cezarypiatek avatar cmtheluke avatar colombod avatar dsyme avatar forki avatar ghvw avatar jackfoxy avatar juergenhoetzel avatar kflu avatar klepeto avatar lukasz-chmielewski avatar m-colombo avatar mathias-brandewinder avatar mscottford avatar ndalchau avatar nojaf avatar queil avatar stewart-r avatar tahahachana avatar thomasrizzo avatar thuris avatar tpetricek avatar zyzhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xplot's Issues

Insert a chart to the web page

Hello,

I've recently found this beautiful lib and tried it for my needs.
I've faced several problems working with XPlot and currently could not find how to display chart on a web page.
I use a https://suave.io to start a web server and the following code

open Suave
let html = chart.GetInlineHtml ()
startWebServer defaultConfig (Successful.OK html )

The problem is that if I do so, then I have no js that is responsible for Plotly display in header, so it fails to render on client site.
Is there any way I could use the chart html like this? Or this way is completely not the way of how this should be used?

animation.startup setting is missing

Set animation: {"startup": true} - setting this in your options will cause your chart to start with series values drawn at the baseline, and animate out to their final state.

Added with:

Configuration.fs (line 8)

 type Animation() =
        
        let mutable durationField : int option = None
        let mutable easingField : string option = None
        let mutable startUpField : bool option = None
        
        member __.startup
            with get() = startUpField.Value
            and set(value) = startUpField <- Some value
             
        member __.duration
            with get() = durationField.Value
            and set(value) = durationField <- Some value

        member __.easing
            with get() = easingField.Value
            and set(value) = easingField <- Some value

        member __.ShouldSerializeduration() = not durationField.IsNone
        member __.ShouldSerializeeasing() = not easingField.IsNone
        member __.ShouldSerializestartup() = not startUpField.IsNone

GoogleCharts: order of WithOptions causes issues rendering chart

When creating a Chart using XPlot.GoogleCharts, if Chart.WithOptions is called after some other chart properties are set, these properties get ignored. If the call is made before them, they are rendered properly.

Expected behavior: order of the calls should not matter
Actual behavior: order of the calls causes some settings to be ignored.

Reproduction: .fsx script, Windows, .net45

#I "./packages/"
#r "Google.DataTable.Net.Wrapper/lib/Google.DataTable.Net.Wrapper.dll"
#r "XPlot.GoogleCharts/lib/net45/XPlot.GoogleCharts.dll"

open XPlot.GoogleCharts

let options = Configuration.Options()
options.lineWidth <- 2

[ 1;2;3;4;5;]
|> Chart.Line
|> Chart.WithTitle "The Title" // line A
|> Chart.WithOptions options // line B
|> Chart.Show

If the order of line A and line B is swapped, the Chart title is not rendered. The same thing happens with other calls, ex: Chart.WithXTitle

Missing POST parameters exception

Hello, I'm not able to create a single plot. Event if I take the one from the tutorial I end up with this exception in F# interactive :

System.Exception: Missing required POST parameters: platform un key origin args kwargs
   at XPlot.Plotly.Figure.Plot(String filename) in C:\Users\AHMED\Documents\GitHub\XPlot\src\XPlot.Plotly\Main.fs:line 560
   at <StartupCode$FSI_0003>.$FSI_0003.main@() in C:\Code\GitHub\BlogSupport\UnivarianteLinearReg\LinearRegressionXPlotPlotly.fsx:line 50
Stopped due to error

This may be linked to this http://community.plot.ly/t/electricimp-missing-required-post-parameters-platform-un-key-origin-args-kwargs/113

Fix DataTable construction

The current implementation makes supporting some charts like sankey diagrams or histograms with multiple series impossible.

Default Sizes of Charts

Default sizing of charts is set statically and by pixels. I need the ability to have it inherit the properties of the encapsulating div and say minus 10%.

The defaults end up forcing me to do something along these lines:
$(function () { $.get("http://fsharpcharttest2.azurewebsites.net/api/values/ScatterPlot", function (data, status) { $("#FSharpChartDivTest_1").append(data); drawChart(); setTimeout( function(){ $("#FSharpChartDivTest_1 svg").css("transform", "scale(.7,.7) translateX(-20%)"); }, 4000); }); });

here is a sample: http://indiedevspot.com/2016/04/16/testing-charts/

Save chart to image

Would be nice to have capability of saving charts to images from code. For example, this will allow to create a couple of FsLab formatters as static image (could be especially useful for implementing LaTeX XPlot formatters). And it's no wonder that this feature is already supported by original libraries:

P.S.: Thanks so much for this library!

Column chart with multiple non-overlapping series

I was trying to create bar chart that would have different colors for different bars.

I suspect the right way to do this in Google would be using the { role: 'style' } thing in data table (here is an example), but I guess this cannot be easily added to XPlot.

So I instead tried creating sequence of sequences with the differently coloured inputs. This behaves as expected when there are some overlaps, but it somehow "merges" the series when there are no overlaps:

[ [1,1.0; 2,2.0]
  [2,1.0; 4,3.0] ]
|> Chart.Column
|> Chart.WithLabels ["First"; "Second"]
|> Chart.WithLegend true


[ [1,1.0; 2,2.0]
  [3,1.0; 4,3.0] ]
|> Chart.Column
|> Chart.WithLabels ["First"; "Second"]
|> Chart.WithLegend true

charts

This might very well be some oddity in Google Charts that we cannot do anything with, but if we can solve this (or support role: style) that would be great.

FSC: error FS0207: No inputs specified

I am running XPlot as a part of FsLab on Xamarin 6.3 for MacOS Sierra.

I have no problems using the Library with F# interactive
however if I try to compile the following code, largely a copy/paste from the GitHub documentation,
I get a compile error.
I don't understand what's wrong. Thanks

Build FAILED.
Errors:

/Users/.../The42project/The42project.fsproj (Build) ->
/Library/Frameworks/Mono.framework/Versions/4.8.1/lib/mono/fsharp/Microsoft.FSharp.Targets (CoreCompile target) ->

FSC: error FS0207: No inputs specified

open XPlot.GoogleCharts
open XPlot.Plotly
open System

let kepler =
    [
        DateTime(2314, 3, 15), 12400, "", ""
        DateTime(2314, 3, 16), 24045, "Lalibertines", "First encounter"
        DateTime(2314, 3, 17), 35022, "Lalibertines", "They are very tall"
        DateTime(2314, 3, 18), 12284, "Lalibertines", "Attack on our crew!"
        DateTime(2314, 3, 19), 8476, "Lalibertines", "Heavy casualties"
        DateTime(2314, 3, 20), 0, "Lalibertines", "All crew lost"
    ]
 
let gliese =
    [
        DateTime(2314, 3, 15), 10645, "", ""
        DateTime(2314, 3, 16), 12374, "", ""
        DateTime(2314, 3, 17), 15766, "Gallantors", "First Encounter"
        DateTime(2314, 3, 18), 34334, "Gallantors", "Statement of shared principles"
        DateTime(2314, 3, 19), 66467, "Gallantors", "Mysteries revealed"
        DateTime(2314, 3, 20), 79463, "Gallantors", "Omniscience achieved"
    ]

(**
Google Annotation Chart
=======================
*)
(*** define-output:annotation ***)
let options = Options(displayAnnotations = true)
 
[kepler; gliese]
   |> Chart.Annotation
   |> Chart.WithOptions options
   |> Chart.WithLabels
    [
        "Kepler-22b mission"; "Kepler-22b title"; "Kepler-22b text"
        "Gliese 163 mission"; "Gliese title"; "Gliese text"            
    ] 
   |> ignore


[<EntryPoint>]
let main args =
    printfn "Arguments passed to function : %A" args
    printfn "hello world"

    0

Loosen Newtonsoft.Json version restrictions for XPlot.Plotly

Currently version 1.4.2 of XPlot.Plotly lib requires Newtonsoft.Json version 9.0.1 EXACTLY. Could you change this to be >= 9.0.1? There is very little chance of having that one referenced by other assemblies, which makes this difficult to use where you want to pull in lots of references.
Thanks

Building errors

After pulling the latest sources I finish with the following build errors. It seems that some modules are missing:

Errors:

/Users/tjaskula/Documents/GitHub/XPlot/XPlot.sln (Rebuild) ->
(Rebuild target) ->
/Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/XPlot.GoogleCharts.WPF.fsproj (Rebuild) ->
/usr/local/Cellar/mono/4.2.0.179/lib/mono/4.5/Microsoft.FSharp.Targets (CoreCompile target) ->

    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(5,21): error FS0039: The namespace 'Controls' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(6,27): error FS0039: The namespace 'Imaging' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(16,7): error FS0039: The namespace or module 'BitmapFrame' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(22,21): error FS0039: The value or constructor 'Window' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(23,11): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(24,11): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(25,11): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(26,11): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(27,11): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(28,29): error FS0039: The type 'WebBrowser' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(29,11): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(30,11): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(31,11): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.GoogleCharts.WPF/WpfExtensions.fs(32,11): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.

/Users/tjaskula/Documents/GitHub/XPlot/XPlot.sln (Rebuild) ->
(Rebuild target) ->
/Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/XPlot.Plotly.WPF.fsproj (Rebuild) ->
/usr/local/Cellar/mono/4.2.0.179/lib/mono/4.5/Microsoft.FSharp.Targets (CoreCompile target) ->

    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(5,21): error FS0039: The namespace 'Controls' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(6,27): error FS0039: The namespace 'Imaging' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(11,5): error FS0039: The namespace or module 'BitmapFrame' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(14,15): error FS0039: The value or constructor 'Window' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(15,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(16,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(17,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(18,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(19,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(20,23): error FS0039: The type 'WebBrowser' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(21,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(22,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(23,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/ChartWindow.fs(24,5): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/WpfExtensions.fs(5,21): error FS0039: The namespace 'Controls' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/WpfExtensions.fs(6,27): error FS0039: The namespace 'Imaging' is not defined
    /Users/tjaskula/Documents/GitHub/XPlot/src/XPlot.Plotly.WPF/WpfExtensions.fs(10,21): error FS0039: The type 'Figure' is not defined

     4 Warning(s)
     31 Error(s)

Time Elapsed 00:00:22.0066570
Running build failed.
Error:
Building /Users/tjaskula/Documents/GitHub/XPlot/XPlot.sln failed with exitcode 1.

Tried to build on both Mac and Windows without success.

Integrating XPlot with FsLab

Hello,
I spent a bit of time playing with XPlot recently and it looks great and very feature complete!

I started Foogle Charts some time ago with the goal of wrapping some nice simple cross-platform visualization library (without too many external dependencies) to eventually replace FSharp Charting as the default visualization library for F# (FSharp Charting is still nice sometimes, but the fact that it is Windows only is becoming a big problem). Looking at XPlot, it looks like you did pretty much all the work already :-) so, I was thinking that we could abandon Foogle Charts and instead make XPlot the main library...

There are a couple of things that would be really nice to do in order to make integrating XPlot with FsLab and other data science projects easier - I'm happy to look into those and send PRs, but wanted to check with you first:

  1. Adding a license - I noticed the project does not have explicit license. Would you mind adding one? (I think Apache 2.0 would be perfect as most other F# projects use it, but anything compatible with it would probably work..)
  2. Avoiding WPF dependency - I tried using XPlot on Mac, but it didn't work well because of the WPF code that is used to show charts. In FsLab we just open a browser (which is poorer user experience, but it works everywhere). Could we extract the WPF code into a separate DLL, so that you get the XPlot behavior if you want, but FsLab can reference WPF-free "core" DLL?
  3. Using ProjectScaffold - All of the projects included in FsLab use Project Scaffold for building & documenting the code. Now, XPlot already has its own (and pretty nice) docs and releases, but I think it would still be valuable to use ProjectScaffold for this - mainly because following the same template makes it easy for others to contribute - they already know how things work (and I believe people also tend to trust OSS projects that use it).

I already did a little bit of work on (2) - see #6 - and I'm happy to create a prototype & PR for (3) so that we can discuss everything there (to make sure it would work for you).

There is no XPlot.D3 nugget to use

First of all good job with the library!

I tried to use the d3 to create some graphs but i didn't find in the public nuget the components.
I builded a nuget locally but it would be nice to have that to being able to distribute the code without having to insert all this repo.

Legend font default doesn't seem right

Amazing library, fantastic work!!!!

The legend/title/axis font used by default on my computer (browser is IE) is a tiny script font - is it possible for the default to be better

snipimage

Cheers
don

Chart Names for Client Side Rendering

Hey,

So all charts get generated with the "drawChart()" function, which I bind the initial chart to the dom and render a new one. Any time a new chart gets rendered, all charts are redrawn. Also, if I need to update a chart, all charts are redrawn.

Any chance we can get an option to name the drawChart function for each chart? Defaulting to drawChart() is great, but an option would be nice.

Add Chart.Line overload taking seq<float>

In many cases, I just want to draw a simple line chart for a list of numbers:

let nums = [ 1.0; 3.0; 2.0; 2.5 ]
nums |> Chart.Line

This is currently not possible because Chart.Line takes seq<#key * #value>. I think for line charts, it makes a good sense to have a "simple" overload - this is annoying especially if you are getting the data from some other source as you'll end up writing a lot of:

nums 
|> Seq.mapi (fun idx v -> idx, v)
|> Chart.Line

I don't think we should have this for all kinds of charts, but we should review & see where this makes sense.

Chart.Show missing

I thried to use XPlot in latest FsLab:

    (*** hide ***)
    #load "packages/FsLab/FsLab.fsx"


    (*** define-output:loading ***)
    open Deedle
    open System.IO


    (*** define-output:chart ***)
    open XPlot.GoogleCharts

    let data =
        [
            "Rome", 2761477, 1285.31
            "Milan", 1324110, 181.76
            "Naples", 959574, 117.27
            "Turin", 907563, 130.17
            "Palermo", 655875, 158.9
            "Genoa", 607906, 243.60
            "Bologna", 380181, 140.7
            "Florence", 371282, 102.41
            "Fiumicino", 67370, 213.44
            "Anzio", 52192, 43.43
            "Ciampino", 38262, 11.
        ]

    let options =
        Options(
            region = "IT",
            displayMode = "markers",
            colorAxis = ColorAxis(colors = [|"green"; "blue"|])
        )

    let chart =
        data
        |> Chart.Geo
        |> Chart.WithLabels ["Population"; "Area"]
        |> Chart.WithOptions options
        |> Chart.Show

    (*** include-it:chart ***)

image

/cc @tpetricek

[Subplots] Multiple charts

  1. is it possible to plot multiple charts / chart combo with the library
    sharing the same x-axis with 2 different vertical scales (one on the right, one on the left)??

In the examples, see thats it's possible to have multiple series in the same chart, some even represented by a bar while others by a line, but they are sharing the same vertical scale.

What would be the syntax to do that ?

  1. would it be possible also to have two charts with the same X-axis one above each other,

look at this financial chart (USDJPY currency). You can see a candlestick chart in the panel above, with the right scale, while there is volume on the same panel on the left scale (omitted)

in the lower panel, there is a (traditional oversold/overbought) indicator (RSI)

capture d ecran 2017-05-11 a 13 39 18

it would be cool to be able to produce this. Thanks

[google] Make "XPlot.GoogleCharts.Deedle" AutoOpen module

It would be nice if you did not have to explicitly open XPlot.GoogleCharts.Deedle when you already need to open XPlot.GoogleCharts.

This could be done by making the module auto-open:

namespace XPlot.GoogleCharts
[<AutoOpen>]
module Deedle =  
  type Chart with 
     ...

[google] Enable legend when Chart.WithLabels is called

When Chart.WithLabels is called, it probably means that the caller wants to display the legend - so it would make sense (if the legend has not been explicitly enabled before), to enable the legend automatically.

In other words, it would be nice if I could write just:

[ czschool.[1975 .. 2010]; euschool.[1975 .. 2010] ]
|> Chart.Line
|> Chart.WithLabels ["CZ"; "EU"]

...and I'd get a legend somewhere. At the moment, I have to do this manually by adding:

|> Chart.WithOptions (Options(legend=Legend(position="bottom")))

Chart.Line sometimes shows erroneous curves in the case of incomplete data

[Cross-posting from https://github.com/fslaborg/FsLab/issues/108]

In the following code, the two plots look quite different:

#load "packages/FsLab/FsLab.fsx"

open Deedle
 open FSharp.Data
 open XPlot.GoogleCharts
 open XPlot.GoogleCharts.Deedle

let wb = WorldBankData.GetDataContext()
 let cz = wb.Countries. Czech Republic .Indicators
 let eu = wb.Countries. European Union .Indicators
 let czforest = series cz. Forest area (% of land area) 
 let euforest = series eu. Forest area (% of land area) 

[ czforest.[1990 .. 1993]; euforest.[1990 .. 1993] ]
 |> Chart.Line
 |> Chart.WithOptions (Options(legend=Legend(position="bottom")))
 |> Chart.WithLabels ["CZ"; "EU"]

[ euforest.[1990 .. 1993]; czforest.[1990 .. 1993] ]
 |> Chart.Line
 |> Chart.WithOptions (Options(legend=Legend(position="bottom")))
 |> Chart.WithLabels ["EU"; "CZ"]

The difference seems to be due to missing data - there is no value for czforest.[1992]. My view is that the last version (interrupted curves) is the correct display of the data.

XPlot relies on things that are not .NET Standard

Looks like XPlot.GoogleCharts can only be .NET Standard if Google.DataTable.Net.Wrapper is also update to be .NET Standard

C:\GitHub\dsyme\XPlot\src\XPlot.GoogleCharts\XPlot.GoogleCharts.fsproj : warning NU1701: Package 'Google.DataTable.Net.Wrapper 3.1.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\GitHub\dsyme\XPlot\XPlot.sln]

Also GoogleCharts.Deedle --> Deedle, but I don't mind about that one so much since I want to get rid of it, and there is a .NET Standard Deedle being prepared in any case

C:\GitHub\dsyme\XPlot\src\XPlot.GoogleCharts.Deedle\XPlot.GoogleCharts.Deedle.fsproj : warning NU1701: Package 'Deedle 1.2.5' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\GitHub\dsyme\XPlot\XPlot.sln]
    9 Warning(s)

System.TypeLoadException: Could not load type 'Deedle.FSharpFrameExtensions' from assembly 'Deedle, Version=1.2.4.0, Culture=neutral, PublicKeyToken=null'.

The complete error is:

System.TypeLoadException: Could not load type 'Deedle.FSharpFrameExtensions' from assembly 'Deedle, Version=1.2.4.0, Culture=neutral, PublicKeyToken=null'.
at XPlot.GoogleCharts.Deedle.Chart.Table.Static[K,V](Frame2 data, FSharpOption1 Options)
at <StartupCode$FSI_0040>.$FSI_0040.main@() in C:\Users\John\documents\visual studio 2015\Projects\DeedleTutorial\DeedleTutorial\Tutorial.fsx:line 190
Stopped due to error

The source code:
// Chart type: Table of Frame - cl cl |> Chart.Table |> Chart.WithOptions(Options(showRowNumber = true, page = "enable", pageSize = 20))

IDE: Visual Studio 2015 Community Edition.
Installed FsLab via Paket.
Paket dependencies file contents:
source https://nuget.org/api/v2

nuget FsLab

paket.lock file contents:
NUGET
remote: https://www.nuget.org/api/v2
specs:
Deedle (1.2.4)
Deedle.RPlugin (1.2.4)
Deedle (>= 1.2.4)
R.NET.Community (>= 1.6.4)
R.NET.Community.FSharp (>= 1.6.4)
RProvider (>= 1.1.13)
DynamicInterop (0.7.4)
Foogle.Charts (0.0.5)
FSharp.Charting (0.90.13)
FSharp.Core (4.0.0.1)
FSharp.Data (2.2.5)
Zlib.Portable (>= 1.10.0) - framework: portable-net40+sl50+wp80+win80
FsLab (0.3.17)
Deedle (1.2.4)
Deedle.RPlugin (1.2.4)
DynamicInterop (0.7.4)
Foogle.Charts (0.0.5)
FSharp.Charting (0.90.13)
FSharp.Data (2.2.5)
Google.DataTable.Net.Wrapper (3.1.2)
MathNet.Numerics (3.10.0)
MathNet.Numerics.FSharp (3.10.0)
Newtonsoft.Json (8.0.2)
R.NET.Community (1.6.4)
R.NET.Community.FSharp (1.6.4)
RProvider (1.1.15)
XPlot.GoogleCharts (1.3.1)
XPlot.GoogleCharts.Deedle (1.3.1)
XPlot.Plotly (1.3.1)
Google.DataTable.Net.Wrapper (3.1.2)
Http.fs (1.5.1)
MathNet.Numerics (3.10.0)
TaskParallelLibrary (>= 1.0.2856) - framework: net35
MathNet.Numerics.FSharp (3.10.0)
FSharp.Core (>= 3.1.2.5)
MathNet.Numerics (3.10.0)
Newtonsoft.Json (8.0.2)
R.NET.Community (1.6.4)
DynamicInterop (0.7.4)
R.NET.Community.FSharp (1.6.4)
R.NET.Community (>= 1.6.4)
RProvider (1.1.15)
DynamicInterop (0.7.4)
R.NET.Community (1.6.4)
R.NET.Community.FSharp (1.6.4)
TaskParallelLibrary (1.0.2856) - framework: net35
XPlot.GoogleCharts (1.3.1)
Google.DataTable.Net.Wrapper
Newtonsoft.Json
XPlot.GoogleCharts.Deedle (1.3.1)
Deedle
XPlot.GoogleCharts (>= 1.3.1)
XPlot.Plotly (1.3.1)
Http.fs
Newtonsoft.Json
Zlib.Portable (1.11.0) - framework: portable-net40+sl50+wp80+win80

I found found this on https://gist.github.com/larjo/252ab41979459fa80a50
I also found this this on StackOverflow [http://stackoverflow.com/questions/34180107/xplot-and-deedle-in-f)

Plotly Offline Option

Firstly, this is a suggestion, rather than an issue, as such.

Secondly, Plotly has recently released their offline API for R and Python and has open sourced the core JavaScript library. This offline option is important for those working in the finance industry, since it removes security issues associated with sending data to a 3rd party for plotting. I don't know what would be involved with regards modifying XPlot to offer a Plotly offline option, but I do think that it would solve the problem mentioned above and with that, potentially create a wider audience for XPlot and FsLab.

Rationalise Plotly and GoogleCharts

Having the option of both these charting libraries is great. However, the APIs to consume them both are very different. GoogleCharts is somewhat similar to FSharp.Charting in that you can chuck lists of tuples and it just works - Plotly is completely different though, where you have to manually assign to x and y fields etc. etc..

It would be nice if the two APIs were brought in sync with one another.

Missing XPlot.GoogleCharts.fsx

When getting the package from Nuget the XPlot.GoogleCharts.fsx is not present.

It is located in version XPlot.GoogleCharts.1.1.6 in the packages directory but not in XPlot.GoogleCharts.1.1.8 version.

Documentation request for subplots

Some clarification of how to make and use subplots in the documentation or an example in
XPlot/src/XPlot.Plotly/Tests/Subplots.fsx
would be very helpful.

I have gotten this far, two axes are made but they are overlaid, and only one plot is visible.

#I "packages/XPlot.Plotly/lib/net45"
#I "packages/Newtonsoft.Json/lib/net45"
#r "XPlot.Plotly.dll"

open XPlot.Plotly
let layout = 
    Layout(
        title = "Heatmap and Time Series Plot beside each other",
        xaxis = Xaxis(),
        yaxis = Yaxis(),
        xaxis2 = Xaxis(),
        yaxis2 = Yaxis()
    )

let data = [ Heatmap(z=[ [ 1;3;4]; [6;4;2]; [8;5;4]]):> XPlot.Plotly.Graph.Trace
             Scatter( y = [1; 3; 6],  xaxis="x2", yaxis="y2") :> XPlot.Plotly.Graph.Trace ]

data 
    |> Chart.Plot
    |> Chart.WithLayout layout

Dependency Error on ver.1.4.1 by Newtonsoft.Json

Hello.
After being going to use ver.1.4.1, a run-time exception about the dependence occurred.
Ver.9.0.0 of Newtonsoft.Json was necessary, but was contents not to be found. I can find only after Ver.9.0.1 , the version of Newtonsoft.Json was not able to use 9.0.0.

After changing it in Ver.1.3.0 for trial, Ver.6.0.0 of Newtonsoft.Json be need this time. Therefore, after changing only the folder name of Newtonsoft.Json of the package folder to 6.0.0 for trial , I succeeded.

Is this a problem only for my environment?

[google] Deedle helpers do not align data correctly

When you run the following code:

let a = series [ 1 => 10.0; 2 => 11.0; 3 => 12.0; ]
let b = series [ 0 => 5.0; 1 => 6.0; 2 => 7.0; 3 => 8.0; ]
[a; b] |> Chart.Line

You get the following result:

bug

The same happens when you use [Series.observations a; Series.observations b] |> Chart.Line, so I suppose the problem is actually not in the Deedle helpers, but somewhere else - in any case, this should do something clever to align the data correctly.

General documentation enhancement

It is great to be able to go to a specific example of a type of plot one might want and to then build on that.

For example, I want a 3D surface plot, so I go to e.g.
https://fslab.org/XPlot/chart/plotly-3d-surface-plots.html, copy and paste code, and I'm good to go.

However, I now want to custom-scale the Z axis, and there's no navigable way to get there.

My proposal is that "Layout" in the code same is hyperlinked to an excellent reference for "Layout", which is much more F# specific than this: https://fslab.org/XPlot/reference/xplot-plotly-layout-layout.html

Apologies this isn't a PR, but in case I don't get round to it, putting it up as a nice-to-have

No way to target PCL

Can't target a PCL and therefor cannot build and re-use charts within Xamarin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.