Hi everyone. I just started using the Kendo UI, and so far it's awesome.
I was previously using highcharts, but kendo is great, because it's a combo of highcharts and jquery UI. So I only need to load one set of scripts!
Anyway, I'm having some issues with formatting my charts.
I'm trying to create a small thumbnail chart for several instances on one page. The chart is supposed to track progress as a percent over a period of a quarter.
You can view what I've got so far here:
http://jmillspaysbills.com/clients/radolo/rockhabits/daily-huddle.html
Obviously right now each chart is loading the same data.
So, I'm having some problems with styling this chart. I have the category axis set up to have 65 points, wich would be the average business days in a quarter (it doesn't need to be exact). And I have the value axis as the points that will be recorded daily as a percentage. This works fine.
First thing I can't get right is trying to skip the major grid lines by 10. Currently it has all 65 lines, but as you can see that looks terrible.
Second, I have this huge padding on the top, left and bottom that I can't seem to get rid of.
Here is my code:
Regarding the Major Grid lines, I've tried majorunit: 10 with no luck. Any ideas what I'm doing wrong?
As for the padding issue, I've tried adding margin of 0 to the plotarea, but that didn't seem to do anything.
Thanks in advance for any help you can give. I certainly appreciate it.
I was previously using highcharts, but kendo is great, because it's a combo of highcharts and jquery UI. So I only need to load one set of scripts!
Anyway, I'm having some issues with formatting my charts.
I'm trying to create a small thumbnail chart for several instances on one page. The chart is supposed to track progress as a percent over a period of a quarter.
You can view what I've got so far here:
http://jmillspaysbills.com/clients/radolo/rockhabits/daily-huddle.html
Obviously right now each chart is loading the same data.
So, I'm having some problems with styling this chart. I have the category axis set up to have 65 points, wich would be the average business days in a quarter (it doesn't need to be exact). And I have the value axis as the points that will be recorded daily as a percentage. This works fine.
First thing I can't get right is trying to skip the major grid lines by 10. Currently it has all 65 lines, but as you can see that looks terrible.
Second, I have this huge padding on the top, left and bottom that I can't seem to get rid of.
Here is my code:
function createChart() {
$(".chart").kendoChart({
theme: $(document).data("kendoSkin") || "default",
legend: {
position: "bottom",
visible: false,
},
chartArea: {
background: "",
margin: 0,
},
plotArea: {
margin: 0,
border: {
width: 0
}
},
seriesDefaults: {
type: "line" ,
border: {
width: 1
},
margin: 0,
width: 1,
markers: {
visible: false,
}
},
series: [{
data: [0, 5, 5, 6, 8, 12, 16, 19, 20, 20, 23, 25, 28, 29, 29, 29, 32, 35, 35],
}],
valueAxis: {
majorUnit: 25,
max: 100,
min: 0,
majorGridLines: {
dashType: "dash",
}
},
categoryAxis: {
max: 65,
min: 0,
line: {
dashType: "dash" //or "dash", "longdash", "dashdot", "longdashdot" and "longdashdotdot"
},
majorGridLines: {
width: 1,
},
categories: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65 ],
majorUnit: 10,
},
tooltip: {
visible: true,
format: "{0}%",
},
axisDefaults: {
labels: {
visible: false
},
majorTickType: "none",
majorGridLines: {
width: 1,
},
}
});
}
$(document).ready(function() {
setTimeout(function() {
createChart();
// Initialize the chart with a delay to make sure
// the initial animation is visible
}, 400);
$(document).bind("kendo:skinChange", function(e) {
createChart();
});
});
Regarding the Major Grid lines, I've tried majorunit: 10 with no luck. Any ideas what I'm doing wrong?
As for the padding issue, I've tried adding margin of 0 to the plotarea, but that didn't seem to do anything.
Thanks in advance for any help you can give. I certainly appreciate it.