2017-11-03 1 views
0

私の仕事の説明が非常に長く、私が.pdfにエクスポートしているときにテキストが非表示になっています(私はタスクの列を広げられません):どのようにテキストを2または3グリッド内の線?テキストを新しい行に強制することは可能ですか?Dhtmlx Gantt chart:.pdfにエクスポート

答えて

0

あなたはグリッド列https://docs.dhtmlx.com/gantt/desktop__specifying_columns.html#settingthetemplateofdatapresentation

次に設定のためDHXガントテンプレートを使用してタスクのテキスト要素に新しいクラスを定義することができます。この

gantt.config.columns = [ 
    {name:"wbs", label:"WBS", width:40, template:gantt.getWBSCode }, 
    {name:"text", label:"Task name", tree:true, width:170, template: function(task) {return "<div class='gantt_multiline'>" + task.text + "</div>"} }, 
    {name:"start_date", align: "center", width: 90}, 
    {name:"duration", align: "center" , width: 60}, 
    {name:"add", width:40} 
]; 

のようなものは、その後、私はちょうど私たちが作業しているエリアを示すために、BGの色を入れている

<style type="text/css"> 
.gantt_multiline { 
    white-space: normal; 
    background-color: #FFE0F9; 
    line-height: 110% !important; 
    font-size:8pt !important; 
} 

このクラスのCSSを定義します。 次に。 PDFにエクスポートするときに、あなただけのヘッダーにこのCSS定義を送信する必要が https://docs.dhtmlx.com/gantt/desktop__export.html#customstylefortheoutputfile

gantt.exportToPDF({ 
     name: "My Page.pdf", 
     header: "<div><style type='text/css'>.gantt_multiline{white-space:normal;background-color:#FFF0F9;line-height:110% !important;font-size:8pt !important;}</style></div>" 
    }); 

また、それは、例えば、DHXガントで行の高さを設定することが可能です gantt.config.row_height = 40;

は、ここで私は、タスクのバーでは、この例では、クラスが大タスク名

敬具のためにのみ適用されていることをhttps://docs.dhtmlx.com/gantt/snippet/213a0e27 注意を複数行の実際の例を見つけました!

関連する問題