Hi,
I have a line chart that displays the medications given to a patient. Each medication is represented by a single series. My model contains a list of array (server bind or datasource, doesn’t really matters), each array
represent a medication/series data.
I would like to have something like this:
Series 1 use List[0], Series2 use List[1], Series 3 use List[2],…
I tried to do it but couldn’t find a way to define the value
member to bound to. I thought that maybe this (http://docs.kendoui.com/api/wrappers/aspnet-mvc/Kendo.Mvc.UI.Fluent/ChartSeriesFactory#methods-Line%28System.Collections.IEnumerable%29)
could work, but again, how do you define the value member?
My model is as follows:
MedicationChartEntry –a specific data point (represents a medication taken per day).
MedicationChartData.MedicationEntries – a list/array of MedicationChartEntry items (represents a specific medication given to a patient during a period).
ReDSChartData.Medications – a list/array of MedicationEntries (represent all the medications given to a patient)
I am looking for something like this:
Thank for the help,
Sharon.
I have a line chart that displays the medications given to a patient. Each medication is represented by a single series. My model contains a list of array (server bind or datasource, doesn’t really matters), each array
represent a medication/series data.
I would like to have something like this:
Series 1 use List[0], Series2 use List[1], Series 3 use List[2],…
I tried to do it but couldn’t find a way to define the value
member to bound to. I thought that maybe this (http://docs.kendoui.com/api/wrappers/aspnet-mvc/Kendo.Mvc.UI.Fluent/ChartSeriesFactory#methods-Line%28System.Collections.IEnumerable%29)
could work, but again, how do you define the value member?
My model is as follows:
MedicationChartEntry –a specific data point (represents a medication taken per day).
MedicationChartData.MedicationEntries – a list/array of MedicationChartEntry items (represents a specific medication given to a patient during a period).
ReDSChartData.Medications – a list/array of MedicationEntries (represent all the medications given to a patient)
public class MedicationChartEntry{ public string Name { get; set; } public int VerticalIndex { get; set; } public float? Dose { get; set; } public DateTime? Date { get; set; } public string DateFormatted { get; set; } public bool HasMarker { get; set; }}public class MedicationChartData{ public string MedicationName { get; set; } public List<MedicationChartEntry> MedicationEntries { get; set; }}public class ReDSChartData{ public float?[] Fluids { get; set; } public float?[] Weights { get; set; } public float?[] BNPs { get; set; } public string[] Dates { get; set; } public List<MedicationChartData> Medications { get; set; }}I am looking for something like this:
<div class="chart-wrapper">@(Html.Kendo().Chart<SensibleMedical.EDC.Models.MedicationChartEntry>(Model.ReDSChartData.Medications) .Name("Medications") .Title("Medications") .Legend(legend => legend.Position(ChartLegendPosition.Bottom)) .Series(series => { series .Line(Model.ReDSChartData.Medications[0].MedicationEntries) .Color("#0098ee") .Axis("Dose"); series .Line(Model.ReDSChartData.Medications[1].MedicationEntries) .Color("#0098ee") .Axis("Dose"); }) .CategoryAxis(axis => axis .Categories(model => model.DateFormatted) .Labels(labels => labels.Rotation(-45)) ) .ValueAxis(axis => axis .Numeric("Dose") .Color("#0098ee") .Min(0) .Max(70) ))</div>Thank for the help,
Sharon.