You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However I don't see how it's possible to do this from Plotly.NET, based on the need to send an axis start and end value.
I've attempted this with the following code, and several variations:
var buttons = new List<UpdateMenuButton>();
for (var time = timeInterval.StartInterval; time < timeInterval.EndInterval; time = time.AddHours(1))
{
buttons.Add(UpdateMenuButton.init(
Label: $"{time:h:mm tt}",
Method: StyleParam.UpdateMethod.Relayout,
Args: new[] { "xaxis.range",
$"{time:yyyy-MM-dd HH:mm:ss} - {time.AddHours(1):yyyy-MM-dd HH:mm:ss}" }
));
}
and
.WithLayout(layout: Layout.init<iConv>(UpdateMenus: new []{UpdateMenu.init(Buttons: buttons)}))
Using the above code, the UpdateMenu appears, the labels are correct, and selecting something does change the X axis range. However, it always changes to 1/1/2000 - 12/31/2000 rather than the desired range.
Activity
kMutagene commentedon Sep 4, 2023
Hi @mg-yolo-enterprises, thanks for reporting this.
I played around a little and it seems like
IEnumerable<string>is just not enough for modellingArgs, as the correct json for your example isnote that the range argument is a real json array with two values, something you cannot put there with just a string.
So we need to allow any type of object in the
Argsarray to solve this.fix plotly#414 :