Gantt Chart PDF Export

How to set column width if isFitToWidth = true

let exportProperties: PdfExportProperties = {
            fitToWidthSettings: {
                isFitToWidth: true,
                gridWidth: "70",
                chartWidth: "30"
            },
            enableFooter: false,
            theme: "Fabric",
            pageSize: 'A3',
            pageOrientation: "Landscape",
            exportType: 'CurrentViewData',
            fileName: `${this.jobNumber} AV Schedule.pdf`,                
            header: {
                fromTop: 0,
                height: 50,
                contents: [
                    {
                        type: 'Text',
                        value: 'AVI-SPL',
                        position: { x: 0, y: 0 },
                        style: { textBrushColor: '#000000', fontSize: 14 },
                    },
                ]
            },
            footer: {
                fromBottom: 100,
                height: 100,
                contents: [
                    {
                        type: 'Text',
                        font: font,
                        value: `${this.jobNumber}  ${this.projectModifiedDate}`,
                        position: { x: 0, y: 12 },
                        size: { height: 30, width: 400 },
                        style: { textBrushColor: '#000000', hAlign: 'Left', vAlign: 'Top', fontSize: 8, penSize: 8 }
                    },
                    {
                        type: 'PageNumber',
                        font: font,
                        pageNumberType: 'Arabic',
                        format: 'Page {$current} of {$total}',
                        position: { x: 0, y: 10 },
                        size: { height: 30, width: 100 },
                        style: { textBrushColor: '#000000', hAlign: 'Left', vAlign: 'Bottom', fontSize: 8, penSize: 8 }
                    },                                                  
                    {
                        type: 'Line',
                        style: { penColor: '#000080', penSize: 1, dashStyle: 'Solid' },
                        points: { x1: 0, y1: 60, x2: 285, y2: 60 }
                    }
                ]
            },
        };


1 Reply

SI Suresh Iyappan Syncfusion Team July 4, 2024 11:09 AM UTC

Hi Yurii Myroshnyk,


Greetings from Syncfusion.


It is not possible to change the column width when isFitToWidth is enabled. When this property is enabled, we allocate 70% of the width to the grid part and 30% to the chart. Each column width is calculated by dividing the total grid width by the number of columns. Hence, it is not possible to achieve your requirement with a workaround.
 

Regards,

Ajithkumar G


Loader.
Up arrow icon