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. Image for the cookie policy date

why isn't the actual value on the waterfall chart?

Index:

@Html.EJS().Chart("DirectOvertimeSection").Series(series =>

{

series.Width(2).XName("xValue").YName("yValue").Marker(mr => mr.DataLabel(dl => dl.Visible(true).Font(ff => ff.FontWeight("600").Color("#252323")).Position(Syncfusion.EJ2.Charts.LabelPosition.Outer))).SumIndexes(ViewBag.sumIndexes).NegativeFillColor("#e56590").Name("OT Control").ColumnWidth(0.9).Type(Syncfusion.EJ2.Charts.ChartSeriesType.Waterfall).DataSource(ViewBag.dataSource).Add();

}).ChartArea(area => area.Border(br => br.Width(0.1))).Width("100%").Height("55%").Axes(axis =>

{

axis.Name("Secondary Axis")

.Minimum(0).Interval(20).LabelFormat("{value}%")

.OpposedPosition(true).Add();

}).PrimaryXAxis(py => py.ValueType(Syncfusion.EJ2.Charts.ValueType.Category).LabelStyle(ls => ls.Size("8px").FontFamily("Arial Black")).LabelIntersectAction(Syncfusion.EJ2.Charts.LabelIntersectAction.None).LabelRotation(-59).CrossesAt(0).MajorGridLines(mg => mg.Width(0)).PlotOffset(20)).PrimaryYAxis(py => py.Minimum(0).MajorGridLines(mg => mg.Width(0))).LegendSettings(lg => lg.Visible(true)).Tooltip(tl => tl.Enable(true)).Render()



Controller :

input2.xValue = "Actual";

input2.yValue = Math.Round(SumdataNoMaster.Actual + SumdataActual, 3);

ViewBag.DataActual = Math.Round(SumdataNoMaster.Actual + SumdataActual, 2);

chartData.Add(input2);


waterfall2.pngwater.png


3 Replies

DG Durga Gopalakrishnan Syncfusion Team December 9, 2022 02:43 PM UTC

Hi Maulana,


Greetings from Syncfusion.


We have ensured your reported scenario with attached snippet. Chart data label is displayed properly for added actual value in chart series datasource. Please check with the below snippet and sample.


public ActionResult Index()

        {

            List<WaterfallChartData> chartData = new List<WaterfallChartData>

            {

                new WaterfallChartData { xValue = "Income", yValue = 4711 },

                //…

           };

            ViewBag.dataSource = chartData;

            ViewBag.intermediateSumIndexes = new int[] { 4 };

            ViewBag.sumIndexes = new int[] { 8 };

            double actualValue = 0;

            foreach (var val in chartData)

            {

                actualValue += val.yValue;

            }

            chartData.Add(new WaterfallChartData { xValue = "Actual", yValue = actualValue });           

            return View();

        }


Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Waterfall1863563417.zip


Please let us know if you have any concerns.


Regards,

Durga Gopalakrishnan.



PG Peter Groft January 20, 2023 07:43 AM UTC

Start subtotals or totals from the horizontal axis

Double-click a data point to open the Format Data Point task pane, and check the Set as total box. Note: If you single-click the column, you'll select the data series and not the data point. To make the column "float" again, uncheck the Set as a total box.

Regards,
Peter



SB Swetha Babu Syncfusion Team January 23, 2023 08:29 AM UTC

Peter,


Thank you for your suggestion.


Loader.
Live Chat Icon For mobile
Up arrow icon