Refactored LCPDataGrid
This commit is contained in:
@ -28,7 +28,9 @@ const LCPChartBlockSettings = ({ attributes, setAttributes }) => {
|
||||
renderYGrid,
|
||||
xGridColor,
|
||||
yGridColor,
|
||||
legendFontSize
|
||||
legendFontSize,
|
||||
includeDataChart,
|
||||
allowChartDataDownload
|
||||
} = attributes;
|
||||
|
||||
// Set local state for legend location and alignment (for UI updates)
|
||||
@ -53,7 +55,24 @@ const LCPChartBlockSettings = ({ attributes, setAttributes }) => {
|
||||
// Render the component
|
||||
return (
|
||||
<div>
|
||||
{/* Grid Settings Panel */}
|
||||
{/* Front-end Chart Settings */}
|
||||
<PanelBody title={__('Grid', 'lcp')} initialOpen={false}>
|
||||
{/* Render the chart on the front-end */}
|
||||
<ToggleControl
|
||||
label={__('Include Data Chart', 'lcp')}
|
||||
checked={includeDataChart}
|
||||
onChange={(value) =>
|
||||
setAttributes({ includeDataChart: value })}
|
||||
/>
|
||||
{/* Allow chart data download */}
|
||||
<ToggleControl
|
||||
label={__('Allow Chart Data Download', 'lcp')}
|
||||
checked={allowChartDataDownload}
|
||||
onChange={(value) =>
|
||||
setAttributes({ allowChartDataDownload: value })}
|
||||
/>
|
||||
</PanelBody>
|
||||
{/* Grid Settings Panel */}
|
||||
<PanelBody title={__('Grid', 'lcp')} initialOpen={false}>
|
||||
{/* Render X-Grid */}
|
||||
<ToggleControl
|
||||
|
||||
Reference in New Issue
Block a user