Skip to content

Conversation

@MatthewTran22
Copy link
Contributor

Description

(Please include a summary of the change and which issue is touched on. Please also include relevant motivation and context.)
Looked into how Plotly works and confirmed that the offset is being caused by the Plotly autorange feature. The change now uses the information in the response data to set the x range. I was able to address the issues that were noted in PR #1409. I changed the logic to check for both enoughData and data[0].x. I added logic to adjust the x-axis min and max values to autofit the line chart. Note that this led to the SliderRangeInterval component being unused in this file

Matthew Tran - @MatthewTran22

Fixes #1187

Type of change

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request
  • You acknowledge that every person contributing to this work has signed the OED Contributing License Agreement and each author is listed in the Description section.

Copy link
Member

@huss huss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to @MatthewTran22 for another contribution to OED. I'm sorry this review took so long as my time was spent elsewhere and I lost track that this was ready for a few days. Overall it is fine. I've made a few comments to consider where the loss of the user selected slider range seems the hardest. Please let me know if anything is not clear, you have thoughts or need anything.

@MatthewTran22
Copy link
Contributor Author

@huss addressed the comments above.

  • Switched line 110 to only check if there is enough data, the second condition was unnecessary
  • Removed the console log from the Line chart component
  • Switched the date comparisons to using moment
  • Fixed the range reset bug when toggling error bars
  • Specified the min and max range for the slider

The slider you mentioned had the same issue as the main line chart. For that logic, we just needed to specify the min and max date range, just like the main line chart

As for the toggling bug you detailed, I found that we still did need to use the sliderRangeInterval that was originally there to save that custom range set by the users. The main difference now is that if we do not have a custom range set by the user, we use the minDate and maxDate as the default range.

Let me know if there are any other improvements I can make in my implementation

Copy link
Member

@huss huss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to @MatthewTran22 for addressing the comments. I want to apologize that it took so long for this review. I made a mistake and my tracking system missed a couple of PRs that were ready. The changes look good and the testing showed it works as desired. Congratulations on another accepted contribution to OED.

@huss huss merged commit 939b9df into OpenEnergyDashboard:development Nov 20, 2025
3 checks passed
@MatthewTran22 MatthewTran22 deleted the 1187-Horizontal-Shift-When-Error-Bars branch November 20, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

horizontal shift when show error bars

2 participants