$(document).ready(
function
() {
function
onChange() {
$(
"#weather-container"
).html(kendo.render(template,
this
.view()));
}
// create a template using the above definition
var
template = kendo.template($(
"#dashwidget-weather-template"
).html());
var
dataSource =
new
kendo.data.DataSource({
transport: {
// specify the XML file to read. The same as read: { url: "books.xml" }
read: {
dateType:
"xml"
}
},
schema: {
// specify the the schema is XML
type:
"xml"
,
// the XML element which represents a single data record
data:
"/weather/current_conditions"
,
// define the model - the object which will represent a single data record
model: {
fields: {
condition:
"condition/text()"
,
temp:
"temp_c/text()"
}
}
},
change: onChange
});
dataSource.read();
});
var splitter = $("#splitter").data("kendoSplitter"); // expand the pane with ID, pane1 splitter.expand("#mainContent"); I get a "splitter is undefined" error. Here is the code...
<div align="center"> <div id="splitter" style="border-color:white; margin:1px; width:80%" align="center"> <div id="menu">Area 1</div> <div id="mainContent">Area 2</div> <div id="rightCol">Area 3</div> </div> </div>
<a href="#" onclick="test()">Expand</a>
$("#splitter").kendoSplitter({ panes: [ { size: "100px", collapsible: false, min: "100px", max: "110px", resizable: false }, { size: "700px", min: "300px", contentUrl: "../default.aspx"}, { size: "100px", collapsible: false, min: "100px", max: "110px", resizable: false } ], orientation: "horizontal" })
function test() { var splitter = $("#splitter").data("kendoSplitter"); // expand the pane with ID, pane1 splitter.expand("#mainContent"); }
$(
"#toDate").kendoDatePicker({
value:
new Date(),
min:
new Date(1950, 0 ,1),
max:
new Date(2049,11,31)
})
Here by default it is giving current date for example 4/27/2010, but I wanted it to diplsay by + 2 days i.e 4/29/2012.Using KendoUI Line graph, I have multiple series of data and I'd like to show in the tooltip additional data pertaining to a single series of data in the tool tip. In this case I want to show the survey count in the tooltip for each product. I also have a market segment that represents the average of all products in the database in which I don't want to show the data. So for Market Segment I don't want to show the Survey Count.
How do I go about doing this?
This link is to my failed jsFiddle Project: http://jsfiddle.net/rodneyhickman/uMTnh/9/
In the jsFiddle project above I get the survey count for the first product they way I want it for product 2, product 3, etc. For the Averages (Market Segment) I don't want to show a survey count.
My markup:
<div >
<div id='chart' ></div>
</div>
​ My JavaScript:
jQuery(function() {
var myData = [
{
"product1": 86.61,
"product2": 85.23,
"marketsegment": 80.17,
"date": "Mar 2011",
"surveyCountProduct1": "2",
"surveyCountProduct2": "4"
},
{
"product1": 87.61,
"product2": 84.23,
"marketsegment": 81.12,
"date": "Mar 2011",
"surveyCountProduct1": "2",
"surveyCountProduct2": "3"
},
{
"product1": 87.91,
"product2": 85.53,
"marketsegment": 81.57,
"date": "Mar 2011",
"surveyCountProduct1": "2",
"surveyCountProduct2": "4"
},
{
"product1": 88.22,
"product2": 85.23,
"marketsegment": 81.90,
"date": "Mar 2011",
"surveyCountProduct1": "2",
"surveyCountProduct2": "4"
},
{
"product1": 88.61,
"product2": 86.13,
"marketsegment": 79.17,
"date": "Mar 2011",
"surveyCountProduct1": "2",
"surveyCountProduct2": "5"
}
];
jQuery('#chart').kendoChart({
title: {
text: "Overall Score out of 100",
align: "left",
font: "18px Arial, Verdana, sans-serif",
color: "#444"
},
seriesDefaults: {
type: "line",
missingValues: "interpolate"
},
legend: {
position: "bottom"
},
tooltip: {
visible: true,
template: "<b>#= series.name #</b><br/>#= dataItem.date #<br/>#= value #<br/>Survey Count= #= dataItem.surveyCountProduct1 #"
},
valueAxis: {
min: 75,
max: 95,
plotBands: [{
from: 75,
to: 80,
color: "#f5f5f5"
},
{
from: 85,
to: 90,
color: "#f5f5f5"
},
{
from: 95,
to: 100,
color: "#f5f5f5"
}]
},
dataSource: {
data: myData
},
series: [
{
name: "Some Product 1",
color: "#004990",
width: 1,
field: "product1",
markers: {
background: "#004990"
}
},
{
name: "Some Product 2",
color: "#8a7967",
width: 1,
field: "product2",
markers: {
background: "#8a7967"
}
},
{
name: " Market Segment Average",
color: "#da7633",
width: 1,
field: "marketsegment",
markers: {
background: "#da7633"
}
}],
categoryAxis: {
labels: {
rotation: -45,
step: 1,
skip: 0
},
categories: ["Mar", "Apr", "May", "Jun", "Jul"]
}
});
});​
Any help would be appreciated.