mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Adds padding property to charts widget (#2029)
* added padding property to charts widget * working on padding problem * Changed default padding value
This commit is contained in:
parent
0a253ef0c3
commit
0869fb06fb
2 changed files with 11 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ const Plot = createPlotlyComponent(Plotly);
|
|||
export const Chart = function Chart({ width, height, darkMode, properties, styles }) {
|
||||
const [loadingState, setLoadingState] = useState(false);
|
||||
|
||||
const { visibility, disabledState } = styles;
|
||||
const { padding, visibility, disabledState } = styles;
|
||||
const { title, markerColor, showGridLines, type, data, jsonDescription, plotFromJson } = properties;
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -55,11 +55,19 @@ export const Chart = function Chart({ width, height, darkMode, properties, style
|
|||
showgrid: showGridLines,
|
||||
showline: true,
|
||||
color: fontColor,
|
||||
automargin: true,
|
||||
},
|
||||
yaxis: {
|
||||
showgrid: showGridLines,
|
||||
showline: true,
|
||||
color: fontColor,
|
||||
automargin: true,
|
||||
},
|
||||
margin: {
|
||||
l: padding,
|
||||
r: padding,
|
||||
b: padding,
|
||||
t: padding,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ export const componentTypes = [
|
|||
},
|
||||
events: {},
|
||||
styles: {
|
||||
padding: { type: 'code', displayName: 'Padding' },
|
||||
visibility: { type: 'code', displayName: 'Visibility' },
|
||||
disabledState: { type: 'code', displayName: 'Disable' },
|
||||
},
|
||||
|
|
@ -235,6 +236,7 @@ export const componentTypes = [
|
|||
},
|
||||
events: [],
|
||||
styles: {
|
||||
padding: { value: '50' },
|
||||
visibility: { value: '{{true}}' },
|
||||
disabledState: { value: '{{false}}' },
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue