TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bhavna Chaudhri
NA
529
21.2k
Kendo Chart in MVC not working.
Oct 22 2020 10:14 AM
These are my code
<div
class
=
"demo-section k-content wide"
>
@(Html.Kendo().Chart(Model)
.Name(
"chart22"
)
.Title(
"Bar Chart"
)
.DataSource(dataSource =>
{
dataSource.Read(read => read.Action(
"AcccountNameBind"
,
"Account"
));
// ds.Filter(filter => filter.Add(model => model.User_Email).IsEqualTo(User_Email));
})
.SeriesColors(
new
string[] {
"#03a9f4"
,
"#ff9800"
,
"#fad84a"
,
"#4caf50"
})
.Series(series =>
{
series.Bar(
model => model.AccountId,
model => model.AccountName
);
})
//.Tooltip(tooltip => tooltip.
// Template("${ User_Email } - ${ Userid }%").Visible(true)
// )
.CategoryAxis(axis => axis
.Name(
"series-axis"
)
.Line(line => line.Visible(
false
))
)
.CategoryAxis(axis => axis
.Name(
"label-axis"
)
.Categories(m => m.AccountName)
)
.ValueAxis(axis => axis
.Numeric()
.Labels(labels => labels.Format(
"{0}"
))
.AxisCrossingValue(0,
int
.MinValue)
)
)
</div>
public
ActionResult AcccountNameBind()
{
try
{
var data = GetAccountData().ToList();
var query = (from a in data
select
new
{
a.AccountId,
a.AccountName,
}).ToList();
if
(query.Count > 0)
{
return
Json(query, JsonRequestBehavior.AllowGet);
}
else
{
return
null;
}
}
catch
(Exception ex)
{
return
Json(ex.Message);
}
}
Reply
Answers (
3
)
Pass model to webapi from .net core application
How To persist data .