We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Set Line Weight on Chart Series in DocIO

I see you can set the line weight using _serie.SerieFormat.LineProperties.LineWeight, but it only excepts enum type OfficChartLineWeight.

How can I set the line weight to any number value?

4 Replies

MJ Mohanaselvam Jothi Syncfusion Team September 15, 2017 11:51 AM UTC

Hi Jesse,

Thank you for using Syncfusion product.

Yes, it is possible to set line weight of chart series using number value. The LineWeight property of series is reflected only when LinePattern is not None(Default). Please find the below code example to set line weight using number value:
 
//Sets line patttern.
serie.SerieFormat.LineProperties.LinePattern = OfficeChartLinePattern.Solid;
//Sets line weight.
serie.SerieFormat.LineProperties.LineWeight = (OfficeChartLineWeight)5; 

Please find the sample which illustrates the same from below link:
http://www.syncfusion.com/downloads/support/forum/132676/ze/GenerateWord_Windows-1228456811.zip

Please let us know if you have any other questions.

Regards,
Mohanaselvam J
 



JS Jesse Seger September 15, 2017 02:11 PM UTC

I guess I meant any number value.  Like, 25, or 18.5.  



MJ Mohanaselvam Jothi Syncfusion Team September 18, 2017 10:44 AM UTC

Hi Jesse,

Thank you for your update.

Yes, it is possible to set any number values (25 or 18.5) to LineWeight within a range between 0 and 1583. It can be achieved by typecasting number value as “OfficeChartLineWeight” as we mentioned in our earlier update.

Code snippet:
 
//Sets line weight.
serie.SerieFormat.LineProperties.LineWeight = (OfficeChartLineWeight)18.5; 
 

Note:
Without typecasting, you cannot directly set the value to LineWeight property.


Please let us know if you have any other questions.

Regards,
Mohanaselvam J
 



JS Jesse Seger September 18, 2017 12:20 PM UTC

Sweet!  Thanks


Loader.
Live Chat Icon For mobile
Up arrow icon