To set Tansparency in trended lines

Hi Team,

I am using trended line for displaying equations and I couldn’t able to set transparency 100 % for that line.

Have treid with the below code with 21.6.0 cells JAR even its not changed to 100% in excel
trendline.setTransparency(1.0);

Kindly do the needfull

Thanks,
Priya.

@priya1995,

Could you please share your sample code (runnable) with your template files (if any) to show the issue, we will check it soon. By the way, did you try setting transparency for trend line in MS Excel manually if it works or not?

PS. please zip the files prior attaching.

@Amjad_Sahi

I have tried setting transparency in Excel manually and it looks fine.

Sample code:

Workbook workbook = new Workbook();
int index=workbook.getWorksheets().get(0).getCharts().get(0).getNSeries().get(0).getTrendLines().add(TrendlineType.LINEAR);
Trendline trendline = workbook.getWorksheets().get(0).getCharts().get(0).getNSeries().get(0).getTrendLines().get(index);
trendline.setDisplayEquation(true);
trendline.setTransparency(1.0);
workbook.getWorksheets().get(0).getCharts().get(0).getNSeries().get(0).getBorder().setDashType(MsoLineDashStyle.DASH);

have attached the sample file for reference.Sample file.zip (70.5 KB)

@priya1995,

Please notice, I am able to reproduce the issue as you mentioned by using your sample file. I found the transparency setting is not working for trendline in the chart. I have logged a ticket with an id “CELLSJAVA-43574” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

@priya1995,
For this sample file, the first 2 series are not set ChartType, so you may set from the 3rd series.
Please try the following code for your reference:

int index=workbook.getWorksheets().get(0).getCharts().get(0).getNSeries().get(2).getTrendLines().add(TrendlineType.LINEAR);
Trendline trendline = workbook.getWorksheets().get(0).getCharts().get(0).getNSeries().get(0).getTrendLines().get(index);
trendline.setDisplayEquation(true);
trendline.setTransparency(1.0);
trendline.setColor(Color.getBlack());  // Color can not be empty.

Let us know your feedback.

@ahsaniqbalsidiqui
it is fixed with the above code
Thanks

@priya1995,

Good to know that your issue is sorted out by the suggested code segment. In the event of further queries or issue, feel free to write us back.