-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
I keep getting the error while using Plotly.NET.CSharp.
Error: (46,5): error CS1061: 'GenericChart' does not contain a definition for 'WithTitle' and no accessible extension method 'WithTitle' accepting a first argument of type 'GenericChart' could be found (are you missing a using directive or an assembly reference?)
It works when I call the Extension directly Plotly.NET.GenericChartExtensions.WithTitle(chart, "foobar") but chart.WithTitle("foobar") does not work.
I think its unsure whether to use F# or C# GenericChart. Any workarounds?
using Ext = Plotly.NET.GenericChartExtensions;
using StyleParam = Plotly.NET.StyleParam;
using Color = Plotly.NET.Color;
using Marker = Plotly.NET.TraceObjects.Marker;
using MarkerSymbol = Plotly.NET.StyleParam.MarkerSymbol;
using Mode = Plotly.NET.StyleParam.Mode;
using Colorscale = Plotly.NET.StyleParam.Colorscale;
using ColorKeyword = Plotly.NET.ColorKeyword;
using Title = Plotly.NET.Title;
var pcaLeadingTrailingChart = Chart.Scatter<double, double, string>(
x: new[] { pc1Values[leadingIdx], pc1Values[trailingIdx] },
y: new[] { pc2Values[leadingIdx], pc2Values[trailingIdx] },
mode: Mode.Markers,
MarkerColor: Color.fromColors(new[] { Color.fromKeyword(ColorKeyword.Red), Color.fromKeyword(ColorKeyword.Blue) }),
Marker: Marker.init(
Size: 10,
Symbol: MarkerSymbol.Circle
),
Name: "Leading/Trailing PCA"
);
Plotly.NET.GenericChartExtensions.WithTitle(pcaLeadingTrailingChart, "Leading/Trailing PCA");
// I think it is meant to work like this but it does not
var pcaLeadingTrailingChart = Chart.Scatter<double, double, string>(
x: new[] { pc1Values[leadingIdx], pc1Values[trailingIdx] },
y: new[] { pc2Values[leadingIdx], pc2Values[trailingIdx] },
mode: Mode.Markers,
MarkerColor: Color.fromColors(new[] { Color.fromKeyword(ColorKeyword.Red), Color.fromKeyword(ColorKeyword.Blue) }),
Marker: Marker.init(
Size: 10,
Symbol: MarkerSymbol.Circle
),
Name: "Leading/Trailing PCA"
).WithTitle("Leading/Trailing PCA");
Error: (46,5): error CS1061: 'GenericChart' does not contain a definition for 'WithTitle' and no accessible extension method 'WithTitle' accepting a first argument of type 'GenericChart' could be found (are you missing a using directive or an assembly reference?)
Metadata
Metadata
Assignees
Labels
No labels