-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 1187 - Horizontal shift when show error bars #1409
base: development
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to @sainmas & @PValdovinos for working on this issue. I have made a couple of comments to consider.
Having seem this work, I'm starting to suspect that the Plotly auto range on the x-axis is the issue. I noticed that this solution cuts off the horizontal part of the error bars that are beyond the original range of the data. Thus, Plotly may be shifting the x-axis values to let them show. I'm okay with losing them to stop the shift in points.
I wanted to ask if any other solution was found. OED has, to a certain extent, tried to avoid directly setting ranges and let Plotly do it automatically. However, per my comment above, this may cause the shift. If this is the only option then I'm open to the change.
As for the slider range noted in the limitations, I have a feeling (without testing) that the slider range calculation is not in sync with the new x-axis range value. If it spans more values then it might be gray in the area between. OED has had and still seems to have some issues with the slider range. It might be nice to track this down but you don't have to do this if you don't want to.
@@ -93,7 +92,8 @@ export default function LineChartComponent() { | |||
legend: { x: 0, y: 1.1, orientation: 'h' }, | |||
// 'fixedrange' on the yAxis means that dragging is only allowed on the xAxis which we utilize for selecting dateRanges | |||
yaxis: { title: unitLabel, gridcolor: '#ddd', fixedrange: true }, | |||
xaxis: { rangeslider: { visible: true }, showgrid: true, gridcolor: '#ddd' } | |||
//Range must be between these values to allow error bars to show properly | |||
xaxis: { rangeslider: { visible: true }, showgrid: true, gridcolor: '#ddd', range: [data[0].x[0], data[0].x[data[0].x.length - 1]]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had an issue where the slider is wrong if there were multiple lines that span different ranges. I think this probably needs to be the min of all first points and the max of all end points to be sure it spans the entire range of all lines.
} else if (!enoughData) { | ||
} | ||
// Checks if there is enough data for at least one valid graph | ||
else if (!data[0].x) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems to have stopped the message about no data in range for the meter. I found this by changing the range outside all points.
Description
When creating a line bar graph and "Show error bars" is checked, the graph horizontally shrinks.
This request changes a check to allow the use of the x-axis values. Which can be used in a range modifier that affects the size of the x-axis. This range modifier allows error bars to not adjust the size of the graph.
Mason Sain - @sainmas
Pedro Valdovinos Reyes - @PValdovinos
Fixes #1187
Type of change
Checklist
Limitations
One potential issue that remains is the fact that the rangeslider still shows grey area on the right and left.