OnAxesChanged issue when resetting datas !
See original GitHub issueHI, i got an interface with 3 graphs in same time. I added the OnAxesChanged so they move together on the X axe ! My problem comes when im trying to change the data while using this functionality (Clear the array and feedback new datas). Example : My graph data are based on 5min, when i change it to 1min and the OnAxesChanged is called, there are no more graph rendered. When i comment OnAxesChanged it works fine ?? there is a render in the OnAxesChanged method and i got others FormsPlot.Render after the datas is changed ! Any ideas ?
protected override void OnLoad(EventArgs e)
{
FormsPlots = new List<FormsPlot>{ formsPlot1, formsPlot2, formsPlot3 };
foreach (var fp in FormsPlots)
fp.AxesChanged += OnAxesChanged;
}
private void OnAxesChanged(object sender, EventArgs e)
{
FormsPlot changedPlot = (FormsPlot)sender;
var newAxisLimits = changedPlot.Plot.GetAxisLimits();
foreach (var fp in FormsPlots)
{
if (fp == changedPlot)
continue;
// disable events briefly to avoid an infinite loop
fp.Configuration.AxesChangedEventEnabled = false;
fp.Plot.SetAxisLimitsX(newAxisLimits.XMin, newAxisLimits.XMax);
**fp.Render();**
fp.Configuration.AxesChangedEventEnabled = true;
}
}
After some tests… I just saw that the time line reset to 1899 i dont know why probably the changedPlot.Plot.GetAxisLimits() is empty ??
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
"There was a problem when resetting your PC. No changes ...
As a workaround for this issue, do this: Open an elevated command prompt. To do this, click Start, type Command Prompt or cmd...
Read more >Reset your Android device to factory settings
To remove all data from your phone, you can reset your phone to factory settings. Factory resets are also called “formatting” or “hard...
Read more >Reset your Chromebook to factory settings
A factory reset erases all user data on your Chromebook's hard drive, including all the files in the Downloads folder. It also erases...
Read more >Do a Factory Data Reset to Troubleshoot Android Phone ...
If you've tried everything and your device is still having issues, a next step is a factory data reset. Watch this video to...
Read more >Microsoft warning: Some files might not be deleted when ...
Microsoft has warned Windows 10 and Windows 11 users that files might not be deleted after resetting the device using the "Remove everything" ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @ticool, I assumed that the problem is related to how exactly you update the data, when you call Render on an empty object (After Clear() or something similar) for which it is impossible to calculate the boundaries, the default axis values are used. 0 recalculated in ODateTime just gives the year 1899. Maybe you should just somehow bypass this moment so that the axis change event is not called for an empty chart. it’s hard to say something more without seeing the update process itself, in any case I’m glad that you managed to solve the problem.