-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Candlestick example in C# #297
Comments
Thanks for your questions/feedback, i did not know that there are differences between tuples for both languages.
No, we will focus on the overloads that take the dimensions of the data as separate arguments (so in the case of candlestick, that would be the one taking ohlc and time data as separate collections each). The reason for this is simply the large overhead of writing 2+ bindings for each chart type instead of initially just 1. This way, all chart types get at least 1 native C# binding faster. The overloads with tupled arguments will be next.
Not much to be done about this, that's just how C# works with generics. The native C# binding will however provide names for the type arguments, so the correct types it will be easier to infer from intellisense (see #285 for more details).
Scrolling via zoom is a plotly property settable on the using Plotly.NET;
var config = new Config();
config.SetValue("scrollZoom",true);
Chart2D.Chart.Point<int,int,string>(
x: new int [] {1,2},
y: new int [] {1,2}
).WithConfig(config);
I would redirect this right back at you 😉 - I don't know how idiomatic usage of Plotly.NET in C# should look like from the C# user perspective. One thing i take away from this issue is the usage of C# tuples for the overloads that take tupled data. Plotly.NET is written in F# with a C# compatibility layer, which comes with some awkwardness for C#. Some of this is solved (see #285), but any kind of feedback is greatly appreciated here. There will be a preview package of the current C# API soon. |
Closing this, as there is now a C# binding available for Chart.Candlestick (and all other finance charts). |
I have a simple program that uses Plotly.NET to create a candlestick chart of S&P 500 data:
https://github.com/dharmatech/PlotlyNetCandlestickCsv/blob/master/PlotlyNetCandlestickCsv/Program.cs
The output in a browser window is as follows:
Questions
Tuple.Create vs C# tuples
Note that here I had to use
Tuple.Create
instead of a native C# tuple:Will we be able to use C# tuples after #296 is implemented?
WithYAxis
Note that the call to
WithYAxis
is currently quite verbose:Are there plans to make this more concise as part of #296?
Responsive layout vs hardcoded
I currently have the chart size hardcoded via:
It would be nice to have the chart resize based on the size of the browser window. I added the following:
but it doesn't seem to have the intended effect.
Zoom with mouse wheel
Is there a way to enable zoom via the mouse wheel?
Comments
Any suggestions regarding making the example a more idiomatic demonstration of Plotly.NET are welcome. 🙂
Thank you for Plotly.NET.
The text was updated successfully, but these errors were encountered: