mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
The following issues were fixed in Graph Visualiser:
1) Allow the user to set the row limit and chart line width. 2) Zoom should only be applied to X-axis, not both. 3) On clicking the 'Generate' button, the chart should return to its original zoom level. 4) Negative values are not displayed. refs #7485
This commit is contained in:
@@ -174,6 +174,14 @@ class DashboardModule(PgAdminModule):
|
||||
'details')
|
||||
)
|
||||
|
||||
self.graph_line_border_width = self.graphs_preference.register(
|
||||
'graphs', 'graph_line_border_width',
|
||||
gettext("Chart line width"), 'integer',
|
||||
1, min_val=1, max_val=10,
|
||||
category_label=PREF_LABEL_DISPLAY,
|
||||
help_str=gettext('Set the width of the lines on the line chart.')
|
||||
)
|
||||
|
||||
def get_exposed_url_endpoints(self):
|
||||
"""
|
||||
Returns:
|
||||
|
||||
@@ -233,6 +233,7 @@ export default function Graphs({preferences, sid, did, pageVisible, enablePoll=t
|
||||
errorMsg={errorMsg}
|
||||
showTooltip={preferences['graph_mouse_track']}
|
||||
showDataPoints={preferences['graph_data_points']}
|
||||
lineBorderWidth={preferences['graph_line_border_width']}
|
||||
isDatabase={did > 0}
|
||||
/>
|
||||
}
|
||||
@@ -265,6 +266,9 @@ export function GraphsWrapper(props) {
|
||||
point: {
|
||||
radius: props.showDataPoints ? DATA_POINT_SIZE : 0,
|
||||
},
|
||||
line: {
|
||||
borderWidth: props.lineBorderWidth,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
legend: {
|
||||
@@ -289,8 +293,11 @@ export function GraphsWrapper(props) {
|
||||
x: {
|
||||
reverse: true,
|
||||
},
|
||||
y: {
|
||||
min: 0,
|
||||
}
|
||||
},
|
||||
}), [props.showTooltip, props.showDataPoints]);
|
||||
}), [props.showTooltip, props.showDataPoints, props.lineBorderWidth]);
|
||||
const updateOptions = useMemo(()=>({duration: 0}), []);
|
||||
|
||||
const onInitCallback = useCallback(
|
||||
@@ -353,5 +360,6 @@ GraphsWrapper.propTypes = {
|
||||
errorMsg: PropTypes.string,
|
||||
showTooltip: PropTypes.bool.isRequired,
|
||||
showDataPoints: PropTypes.bool.isRequired,
|
||||
lineBorderWidth: PropTypes.number.isRequired,
|
||||
isDatabase: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user