question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OnAxesChanged issue when resetting datas !

See original GitHub issue

HI, 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
StendProgcommented, Mar 9, 2021

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.

0reactions
ticoolcommented, Mar 6, 2021

image

image

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found