Hi all,
I am very new in kendo UI.
I am trying to create a stacked bar graph using remote connection and my code is as below:
<!doCTYpe html>
<html>
<head>
<link href="kendo.metro.min.css" rel="stylesheet">
<link href="kendo.common.min.css" rel="stylesheet">
<script src="jquery.min.js"></script>
<script src="kendo.all.min.js"></script>
</head>
<body>
<div id="example">
<div class="demo-section k-content wide">
<div id="chart"></div>
</div>
<script>
var sharedDataSource = new kendo.data.DataSource({
transport: {
read: {
url: "http://localhost/Project_Demo/Kendobardata.php",
dataType: "json"
}
},
schema: {
data: "data",
model: {
fields: {
wordpress: {type: "number"},
month: {type: "string"}
}
}
}
});
$("#chart").kendoChart({
dataSource: sharedDataSource,
title: {
text: "Charts Rating"
},
legend: {
visible: false
},
seriesDefaults: {
type: "bar",
stack: true
},
series: [{
name: "wordpress",
field: "wordpress",
color: "#3CB371"},
{
name: "codeigniter",
field: "codeigniter",
color: "#FFA500"
},
{
name: "highcharts",
field: "highcharts",
color: "#FF0000"
}],
valueAxis: {
line: {
visible: true
},
minorGridLines: {
visible: true
}
},
categoryAxis: {
field: "month",
majorGridLines: {
visible: false
}
},
tooltip: {
visible: true,
template: "#= series.name #: #= value #"
}
});
</script>
</div>
</body>
</html>
I am finding a difficulty to get the series "name" as dynamic which will come from database.
let say example:
There are 10 "appointment owner", their respective "appointment count" values and "months" are in json format.
I want to create a stacked bar graph in that month will be on category axis and in series appointment owner and appointment count should be their.
Kindly please help me to achieve this.
Thanks,
Amit