fslaborg / xplot Goto Github PK
View Code? Open in Web Editor NEWA collection of older plotting libraries for F#. Recommended to use Plotly.NET instead https://plotly.net/
Home Page: http://fslaborg.github.io/XPlot/
License: Apache License 2.0
A collection of older plotting libraries for F#. Recommended to use Plotly.NET instead https://plotly.net/
Home Page: http://fslaborg.github.io/XPlot/
License: Apache License 2.0
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.
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?
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
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 ***)
/cc @tpetricek
It seems like WithOptions and WithLayout are the same:
member __.WithOptions options = __.WithLayout options
Probably it will be better to remove WithOptions
or make it obsolete to avoid confusing.
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.
In the main page, Documentation section, the link "you can find in the docs/content folder on GitHub" points to the wrong repository.
are there any plans for this?
I tried to randomly use on of the Plotly charts (http://tahahachana.github.io/XPlot/chart/plotly-heatmaps.html) and the docs seem to be out-of-date. Is that the case, or am I doing things wrong?
Also, if they are out of date, is there an issue tracking the progress on getting this fixed? Perhaps people can contribute?
It's been long enough since .NET Core released.
In comparison to python version of plotly library, the subplots functionality I'm mostly missing in Xplot. Target behavior see https://plot.ly/python/subplots/
See also discussion fsprojects/IfSharp#186
I believe, that this feature is the enabler for many machine learning helper algorithms that are already implemented in the python libraries (like Pandas or Seaborn) which make life of data engineers much easier.
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.
Add the Google chart type of Interval as a vaild chart type in XPlot. Here is the info https://developers.google.com/chart/interactive/docs/gallery/intervals
Can't target a PCL and therefor cannot build and re-use charts within Xamarin.
As an example, https://fslab.org/XPlot/reference/xplot-googlecharts-chart.html displays signatures such as
Annotation(data, Labels, Options)
Signature: (data:seq<'?7734> * Labels:seq<string> option * Options:Options option) -> GoogleChart
Type parameters: '?7734, 'V
For instance, seq<'?7734>
is incorrect.
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
The following link in navigation menu is broken:
https://fslab.org/XPlot/reference/xplot-plotly-graph-layout.html
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:
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).
When using XPlot,Plotly, one has to create a layout val even just to change a minor element. Since the Layout type contains so many components, I think it would be a good idea to have separate functions to allow users to set each value, such as:
Scatter(x=x, y=y)
|> Chart.Plot
|> Chart.WithYaxis Yaxis(tickformat=".0%")
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
This issue was originally reported here.
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:
here is a sample: http://indiedevspot.com/2016/04/16/testing-charts/
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
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:
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.
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
Is there any particular reason why the NuGet packages forces version 6.05 of Newtonsoft.Json? Can it be be >= 6.05?
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 ?
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)
it would be cool to be able to produce this. Thanks
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!
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
The current implementation makes supporting some charts like sankey diagrams or histograms with multiple series impossible.
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
...
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)
http://tahahachana.github.io/XPlot/chart/google-sankey-diagram.html
In Chrome, I see "d3.sankey is not a function".
The following generates invalid JavaScript:
[ ("\n", 42) ] |> Chart.Column
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")))
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.
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
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.
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, FSharpOption
1 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)
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?
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.
We expect
.\build GenerateDocs
to work. Or this with updated dotnet fake
:
.\build target GenerateDocs
Both fail.
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.
[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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.