I am creating a bubble chart by using MVC and would like to bind this chart from local data as the example in the link http://demos.telerik.com/aspnet-mvc/bubble-charts/local-data-binding.
The model I use is slightly different from the example. I have a view model object,BubbleChartModel,contains a IEnumberable<MVCSample.Data.PGDataBySupplier> property called "DataPoints".
When I tried to bind the bubbles to this IEnumberable<MVCSample.Data.PGDataBySupplier> property, I received the error of
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[MVCSample.Data.PGDataBySupplier]', but this dictionary requires a model item of type 'MVCSample.Models.BubbleChartModel'.
I am wondering if my approach is supported by Telerik. If not, is there any workaround?
Following is my code:
@model MVCSample.Models.BubbleChartModel
<div class="chart-wrapper">
@(Html.Kendo().Chart(Model.DataPoints)
.Name("chart")
.Series(series =>
{
series.Bubble(
model => model.PercentSavingsLow,
model => model.PotentialSavingsAvg,
model => model.TotalSpend,
model => model.ProviderShortName,
model => model.MemberStatECOLOR,
model => model.DisplayLegend,
model => model.ProviderShortName
);
}
)
)
)
The model I use is slightly different from the example. I have a view model object,BubbleChartModel,contains a IEnumberable<MVCSample.Data.PGDataBySupplier> property called "DataPoints".
When I tried to bind the bubbles to this IEnumberable<MVCSample.Data.PGDataBySupplier> property, I received the error of
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[MVCSample.Data.PGDataBySupplier]', but this dictionary requires a model item of type 'MVCSample.Models.BubbleChartModel'.
I am wondering if my approach is supported by Telerik. If not, is there any workaround?
Following is my code:
@model MVCSample.Models.BubbleChartModel
<div class="chart-wrapper">
@(Html.Kendo().Chart(Model.DataPoints)
.Name("chart")
.Series(series =>
{
series.Bubble(
model => model.PercentSavingsLow,
model => model.PotentialSavingsAvg,
model => model.TotalSpend,
model => model.ProviderShortName,
model => model.MemberStatECOLOR,
model => model.DisplayLegend,
model => model.ProviderShortName
);
}
)
)
)