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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Chart Column Different Color

Thread ID:

Created:

Updated:

Platform:

Replies:

132439 Sep 1,2017 05:03 PM UTC Sep 12,2017 09:53 AM UTC ASP.NET MVC 3
loading
Tags: Chart
Gian Carlo
Asked On September 1, 2017 05:03 PM UTC

Hi i would like to know if its possible to put different color on each Column series that its generated by data source??

.Series(ser =>

       {

           ser.Name("My Brands");

           ser.DataSource((IEnumerable<object>)ViewBag.brand);

           ser.LabelPosition(ChartLabelPosition.Outside);

           ser.Marker(mr => mr

                     .DataLabel(label => label

                         .Visible(true)

                         .Offset(15)

                         .Font(font => font.Color("black").Size("12px"))

                         )

                 );

           ser.Explode(true);

           ser.XName("Brand");

           ser.YName("Total");

           ser.Font(f =>

           {

               f.Size("px");

               f.Color("#8CC640");

           });

           ser.Add();


       })


Saravana Kumar Kanagavel [Syncfusion]
Replied On September 4, 2017 04:52 AM UTC

Hi Gian, 
 
Thanks for contacting Syncfusion Support. 
We have analyzed your query and achieved your requirement by using “pointColorMapppingName” property in the series . “pointColorMapppingName” property is used to get the fill color of each points from the data source. 
 
Please refer the code example below 
 
[CSHTML] 
@(Html.EJ().Chart("container") 
         .Series(ser => 
         {  
            ser.PointColorMappingName("Color"); 
         }) 
)    
 
Here ‘color’ is the name of the field, which holds the color values in the data source. We have prepared a sample for your reference and attached in the below location. 
 
  
Please find the output of the sample below 
 
 
Please let us know if you have any concern.

Regards,
Saravana Kumar K 
 



Gian Carlo
Replied On September 11, 2017 04:48 PM UTC

Thx a lot for the reply,


Saravana Kumar Kanagavel [Syncfusion]
Replied On September 12, 2017 09:53 AM UTC

Hi Gian, 

Thanks for the update. 

Please let us know if you need any further assistance on this. 

Regards, 
Saravana Kumar K. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;