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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add data label dynamically

Thread ID:

Created:

Updated:

Platform:

Replies:

143359 Mar 15,2019 02:22 PM UTC Mar 18,2019 08:56 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: Charts
Rikard Schouwstra
Asked On March 15, 2019 02:22 PM UTC

Hi,

How do you add data labels to a series dynamically?

Regards

Dharanidharan Dharmasivam [Syncfusion]
Replied On March 18, 2019 08:56 AM UTC

Hi Rikard, 
 
Greetings from Syncfusion.  
 
We have analyzed your requirement. We suspect that, your requirement is to bind the data for data label from data source dynamically. If so, using the name property in dataLabel, you can map the field from your data source. For more information on data label, find the user guide.  
 
Find the code snippet below to achieve this requirement. 
[ChartFeatures.cshtml] 
 
<ejs-accumulationchart id="pieChart"> 
            <e-accumulation-series-collection> 
                <e-accumulation-series> 
      <e-accumulationseries-datalabel visible="true" name="text"></e-accumulationseries-datalabel> 
</e-accumulation-series> 
            </e-accumulation-series-collection> 
        </ejs-accumulationchart> 
 
 
[ChartController.cs] 
 
List<LineChartData> chartData = new List<LineChartData> 
            { 
                new LineChartData { xValue = "X1", yValue = 21, text = "X1 Data" }, 
                //... 
            }; 
            ViewBag.dataSource = chartData; 
 
 
 
 
If this is not your exact requirement, kindly provide more information on your query. This will be much helpful in further analysis and provide you the solution sooner. 
 
Thanks, 
Dharani. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon