This is a migrated thread and some comments may be shown as answers.

Kendo Line Chart Problem

0 Answers 32 Views
Sample Applications
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rajib
Top achievements
Rank 1
Rajib asked on 18 Mar 2015, 01:18 PM
Sir,

First of all A Big thanks to the Development Teams for the awesome GUI .

Now i am going to state the problem. I have a Kendo chart in my view like:

   @(Html.Kendo().Chart<.DrugCashFlow.PackagePrice>()
                .Name("PriceDateChart")
                .Title("Line graph of prices").AutoBind(false)
                        .DataSource(datasource => datasource
                                    .Read(read => read.Action("GetFuturePricesForChart", "Fpm").Data("GetInputData"))
            )
                       .Series(series =>
                       {
                           series.Column(model => model.Price.AverageWholesalePrice)
                               .Name("AverageWholesalePrice");
                       })
            .Legend(legend => legend
                .Position(ChartLegendPosition.Top)
            )
            .ValueAxis(axis => axis.Numeric()
                .Labels(labels => labels
                    .Format("{0}")
                    .Skip(2)
                    .Step(2)
                )
            )
            .CategoryAxis(axis => axis.Date()
                .Categories(model => model.Price.MedispanEffectiveDate)
                        .BaseUnit(ChartAxisBaseUnit.Years)
            )
            .Tooltip(tooltip => tooltip
                .Visible(true)
                .Format("{0}")
                .Template("#= series.name #: #= value #")
            )
        ) 
    </div>

and the controller for this is:
      public ActionResult GetFuturePricesForChart(String VendorName, String DrugName, String PeriodType, String Outlook, String EndDate, String Current_Price)
        {
            FpmOutputParams _output = GetFuturePricesFromService(VendorName, DrugName, PeriodType, Outlook, EndDate, Current_Price);

            if (_output == null)
                return (Json(new List<DrugCashFlow.PriceData>()));

            List<PackagePrice> pkgPxList = new List<PackagePrice>();

            foreach (var _x in _output.Prices) 
            {
                DateTime _effDate = _x.EffectiveDate;

                foreach (var _y in _x.DosagePriceList)
                {
                    _y.AveragePrice.Price.MedispanEffectiveDate = _effDate;
                    pkgPxList.Add(_y.AveragePrice);
                }
            }

            return Json(pkgPxList);
        }



but I am not getting data on the chart. Please help me 








Tags
Sample Applications
Asked by
Rajib
Top achievements
Rank 1
Share this question
or