Format Y-axis in decimal

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.

1 Reply

AB Akbar Basha K M Syncfusion Team 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



Loader.
Up arrow icon