Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Text Wrapping of x axis labels and task labels in gantt chart
Migrateduser
Hi All,
I am working on a Gantt chart using Birt 4.2 and facing few issues with the same.
I am using flat file data source and a csv file as my dataset.
I am mapping a row[Work] as X axis which contains a String of all category names and mapped a row[X]as task labels which contains the string of all Subcategories.
Now the length of these two text fields can be more than 100 characters.
I want to wrap these text labels.
I tried the following wrap function in the script:
function beforeDrawAxisLabel( axis, label, icsc )
{
var tst = label.getCaption().getValue();
var wrap = 15;
var repeat = Math.floor(tst.length() / wrap);
var str = tst;
if(repeat > 0)
{
str = "";
for(i = 0; i < repeat; i++)
{
str += tst.substring((i*wrap),((i+1)*wrap-1))+"\r\n";
}
if((tst.length() % wrap) > 0)
{
str += tst.substring((i*wrap-1),tst.length());
}
}
label.getCaption().setValue(str);
}
This is working for X axis labels not what needs to be done to wrap the task labels.
I even tried the following custom function:
CustomFunctions.TextWrap(dataSetRow["X"], 20)
but it returns blank or null values.
Even setting the property white space to normal or no wrapping does not make any effect.
The second issue is adding text labels to x axis and task label as "Category" and "Subcategory".
Can we add a static text field inside the chart area. Actually the report allows to add the text field above or below the chart area.
Another formatting issue is of Y axis scale.
As the task labels are long I just changed the Y axis scale to start from two years prior to the project.
Now the client wants that particular scale (of 2 years) which has no data to be invisible. That I need to hide the particular range of Y axis labels in gantt chart.
I have attached my csv file and design file for your reference.
Regards,
Kavita
Find more posts tagged with
Comments
There are no comments yet