Hello everyone,
I am developing an election app via MVC3(Due to some restrictions). I did everything. It works fine. However, I need some charts to visualize my app.
Found something, working fine with 'static numbers'. I want to load my own data which comes from database. I am not good at Javascript. Here is where I have troubles.
var barChartData = {
labels: ["App1", "App2", "App3", "App3", "App4", "App5", "Soru6"],
datasets: [
{
fillColor: "rgba(233, 78, 2, 0.9)",
strokeColor: "rgba(233, 78, 2, 0.9)",
highlightFill: "#e94e02",
highlightStroke: "#e94e02",
data: [65, 59, 90, 81, 56, 55, 40]
},
{
fillColor: "rgba(79, 82, 186, 0.9)",
strokeColor: "rgba(79, 82, 186, 0.9)",
highlightFill: "#4F52BA",
highlightStroke: "#4F52BA",
data: [40, 70, 55, 20, 45, 70, 60]
}
]
};
First, I want to load some labels into Labels array from db . (Table: User, Column Apps)
Then, I want to load some data into data array. (Table UserQuestion, Column QuestionAnswerRate)
I am able to get both of these data via Model or ViewBag. However can't load into array.
How can I do this?
What I have tried:
I have tried
1- To load via ViewBag
2- To load via Model