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

DataLabel in Bar Graph not shown all value

Thread ID:

Created:

Updated:

Platform:

Replies:

141664 Dec 26,2018 09:36 AM UTC Dec 31,2018 05:58 AM UTC ASP.NET MVC - EJ 2 3
loading
Tags: Chart
afiqdoherty
Asked On December 26, 2018 09:36 AM UTC

below in my code to generate bar graph. by default, not all bar is labelled. please refer attached picture. really appreciate if you can help me with this. thanks :)



@(Html.EJS().Chart("graph_bar").Height("258").Width("743").Series(sr =>
  {
                                 sr.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Column).Marker(ViewBag.Marker).XName("x").YName("yValue2").DataSource(ViewBag.dataSource).Name("Red").Width(3).Add();
                                 sr.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Column).Marker(ViewBag.Marker).XName("x").YName("yValue1").DataSource(ViewBag.dataSource).Name("Yellow").Width(3).Add();
      sr.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Column).Marker(ViewBag.Marker).XName("x").YName("yValue").DataSource(ViewBag.dataSource).Name("Green").Width(3).Add();
    }
     ).LegendSettings(legend => legend.Width("104%")
     ).PrimaryYAxis(px => px.Minimum(0).Maximum(50).Interval(10).LabelStyle(ViewBag.Style).LineStyle(ViewBag.Line).MajorTickLines(ViewBag.Line).MajorGridLines(ViewBag.line).LineStyle(ViewBag.lineStyle)
     ).PrimaryXAxis(px => px.Interval(1).ValueType(Syncfusion.EJ2.Charts.ValueType.Category).MajorGridLines(ViewBag.line).MinorGridLines(ViewBag.minorGridLines)
     ).LegendSettings(legend => legend.Alignment(Syncfusion.EJ2.Charts.Alignment.Center)
     ).ZoomSettings(z => z.EnableMouseWheelZooming(true)
     ).Tooltip(tt => tt.Enable(true)
     ).ChartArea(area => area.Border(ViewBag.ChartBorder)
     ).Title("Statistic by Mode (BL Manifest)").Load("load").Render()
                    )


Kalaimathi Chellaiah [Syncfusion]
Replied On December 26, 2018 11:27 AM UTC

Hi Muhammad, 
 
Greetings from Syncfusion. 
 
We have analyzed query with attached code snippet. Consider the following sample here we have created chart with datalabel in version 16.4.0.42. Already we got datalabel property through an viewBag from code behind. Now we gave lambda support for all property. Please find below code snippet which was used to show all label values of the chart. 
chartFeatures.cshtml 
@(Html.EJS().Chart("graph_bar").Width("743").Series(sr => 
{ 
    sr.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Column).Marker(mr=> mr.Visible(true).DataLabel(dl=> dl.Visible(true))).XName("xValue").YName("yValue2").DataSource(ViewBag.dataSource).Name("Red").Width(3).Add(); 
    /… 
} 
) 
   ) 
 
Screenshot: 
 
 
Regards, 
Kalai 


afiqdoherty
Replied On December 27, 2018 03:53 AM UTC

Thanks Kalai,

this solution works.

afiq :)

Dharanidharan Dharmasivam [Syncfusion]
Replied On December 31, 2018 05:58 AM UTC

Hi Muhammad, 
 
We are happy to hear that provide solution works at your end. Kindly revert us, if you would require further assistance. 
 
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

;