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

Format Y-axis in decimal

Thread ID:

Created:

Updated:

Platform:

Replies:

117969 Jan 14,2015 11:17 AM UTC Jan 15,2015 08:13 AM UTC ASP.NET MVC 1
loading
Tags: Chart
Pankaj
Asked On January 14, 2015 11:17 AM UTC

Hi Team,
Below is my code which i use to show the chart.But my Y-axis data is not display in decimal format it show integer value.

@(Html.EJ().Chart("container")
                  .PrimaryXAxis(pr => pr.Title(tl => tl.Text(SyncFusionBarChartProp.xAxisTitle)).ValueType(AxisValueType.Category))
                  .PrimaryYAxis(pr => pr.Title(tl => tl.Text(SyncFusionBarChartProp.yAxisTitle)).ValueType(AxisValueType.Double).LabelFormat("{value}"))//want to display in decimal format.
                  .CommonSeriesOptions(cr => cr.EnableAnimation(true).Tooltip(tt => tt.Visible(true).Format("#series.name# <br/> #point.x# : #point.y#"))
                  .Marker(mr => mr.DataLabel(dt => dt.Visible(true).Angle(0).TextPosition(TextPosition.Top)
                  .Font(fn => fn.Color("#282828").Size("13px").FontFamily("Segoe UI")))))
                  .Series(sr =>
                  {
                      sr.Name(SyncFusionBarChartProp.yAxisTitle)
                      .Type(SyncFusionBarChartProp.ChartType)
                      .DataSource((System.Collections.IEnumerable)ViewBag.datasource)//bind the data through viewbag
                      .XName("XAxis")
                      .YName("YAxis")
                      .Add();
                  })
        .Load("loadTheme")
        .DisplayTextRendering("OndataLabel")
        .CanResize(true)
        .Title(t => t.Text(SyncFusionBarChartProp.ChartTitle))
        .Legend(lg => { lg.Visible(true).Position(LegendPosition.Bottom).Alignment(Syncfusion.JavaScript.DataVisualization.TextAlignment.Center); })
    )
So please let me know how can i implement it.

Akbar Basha K M [Syncfusion]
Replied On January 15, 2015 08:13 AM UTC

Hi Pankaj,

Thanks for using syncfusion product. We have analyzed your requirement. You can achieve this requirement using labelFormat property as follows,

Code Snippet:

PrimaryYAxis(pr => pr.LabelFormat("n1"))

We have prepared a sample based on your requirement. Please find the sample under the following location.

Sample Location: http://www.syncfusion.com/downloads/support/directtrac/117969/Label_Format1379665334.zip

Please let us know if you have any concern.

Regards,

Akbar Basha KM



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

;