mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-21 16:27:39 -06:00
Fixed an issue where graph visualizer pie chart was showing X axis, Y axis and grid lines.
This commit is contained in:
parent
441cc57bb8
commit
23ea201325
@ -112,7 +112,7 @@ export default function BaseChart({type='line', id, options, data, redraw=false,
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
let theme1 = {
|
let scaleColors = {
|
||||||
scales: {
|
scales: {
|
||||||
x: {
|
x: {
|
||||||
ticks: {
|
ticks: {
|
||||||
@ -130,7 +130,11 @@ export default function BaseChart({type='line', id, options, data, redraw=false,
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let merged = _.merge(options, theme1);
|
let merged = options;
|
||||||
|
// Override only if scales are actually defined.
|
||||||
|
if(options.scales && Object.keys(options.scales).length > 0) {
|
||||||
|
merged = _.merge(options, scaleColors);
|
||||||
|
}
|
||||||
chartObj.current.options = merged;
|
chartObj.current.options = merged;
|
||||||
chartObj.current.update(props.updateOptions || {});
|
chartObj.current.update(props.updateOptions || {});
|
||||||
},[theme]);
|
},[theme]);
|
||||||
@ -213,7 +217,7 @@ export function PieChart({options, ...props}) {
|
|||||||
let optionsMerged = _.merge({
|
let optionsMerged = _.merge({
|
||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
normalized: true
|
normalized: true,
|
||||||
}, options);
|
}, options);
|
||||||
return (
|
return (
|
||||||
<BaseChart {...props} options={optionsMerged} type='pie'/>
|
<BaseChart {...props} options={optionsMerged} type='pie'/>
|
||||||
|
Loading…
Reference in New Issue
Block a user