or
hi
i have a dataSource that spits out data like this:
after feb - the 'budget' MDetail falls off to 0
and before jun - i dont know what the 'projected' MDetail does
its drawing a bunch of stuff
what im trying to achieve here is:
if there are no records for anything after feb
then dont draw anything - just cut it off
ie dont descend to 0
and likewise if there are no records for the beginning
then dont draw anything until theres a record for the category
ie it iwll be blank until jun and then the 'projected' numbers start drawing
how do i do this?
thanksa!
[{
Amount: "2140402000"
MDetail: "Budget"
Month: "Jan"
Monthnum: "1"
Year: "2013"
},
{
Amount: "2146823206"
MDetail: "Budget"
Month: "Feb"
Monthnum: "2"
Year: "2013"
},
{
Amount: "2257798847"
MDetail: "Projected"
Month: "Jun"
Monthnum: "6"
Year: "2013"
},
{
Amount: "2272474540"
MDetail: "Projected"
Month: "Jul"
Monthnum: "7"
Year: "2013"
}]
$J("#chart").kendoChart({
dataSource: {
data:source,
group: {
field: "MDetail",
dir: "asc"
},
sort: [
{field: "Year", dir: "asc"},
{field: "Monthnum", dir: "asc"}
]
},
theme: "blueOpal",
title: {
text: "Total Cost of Workforce for " + year
},
legend: {
position: "bottom"
},
seriesDefaults: {
type: "area",
format: "${0:0,000}"
},
series: [{
field: "Amount",
groupNameTemplate: "#= group.value # "
}],
valueAxis: {
labels: {
template: "#= kendo.format('$ {0:N0}', value / 1000000) # M"
},
majorUnit: 100000000,
line: {
visible: false
},
axisCrossingValue: -10
},
categoryAxis: {
field: "Month",
majorGridLines: {
visible: false
}
},
tooltip: {
visible: true,
format: "$ {0:0,000}"
}
});
@model <
BaseFormModel
>
@{
Model.Demographics = Model.GetFormDemographics(Model.PlanActivityId, Model.Id, 0);
}
<
div
class
=
"modalContent"
>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<
fieldset
>
<
legend
>Edit Events</
legend
>
<
div
>
<
label
>Month</
label
>
@Html.TextBoxFor(model => model.StartMonth, new { @placeholder = "mm" })/@Html.TextBoxFor(model => model.StartYear, new { @placeholder = "yyyy" })
</
div
>
<
div
>
<
label
>Event Name</
label
>
@Html.TextBoxFor(m => m.FormName)
</
div
>
<
div
>
<
label
>Number of brochures distributed(if applicable)</
label
>
@Html.TextBoxFor(m => m.Count2, new { @maxlength = 3 })
</
div
>
<
div
>
<
label
>Number of attendees</
label
>
@Html.TextBoxFor(m => m.Count, new { @id = "txtNumberOfAttendees" })
</
div
>
<
a
id
=
"autoPopulate"
>Populate based on my county census and number of attendees.</
a
>
<
h2
>Target Demographics</
h2
>
@*@{
Html.RenderAction("GetFormDemographics", "Form", new { planActivityId = ViewBag.PlanActivityId, formId = Model.Id, spUserId = 0 });
}*@
@{
Html.RenderPartial("_PartialDemographicsEditor",model: Model.Demographics);
}
</
fieldset
>
}
</
div
>
private
function
where(
$properties
,
$filter
,
$all
) {
if
(isset(
$filter
->filters)) {
$logic
=
' AND '
;
if
(
$filter
->logic ==
'or'
) {
$logic
=
' OR '
;
}
$filters
=
$filter
->filters;
$where
=
array
();
for
(
$index
= 0;
$index
<
count
(
$filters
);
$index
++) {
$where
[] =
$this
->where(
$properties
,
$filters
[
$index
],
$all
);
}
$where
= implode(
$logic
,
$where
);
return
"($where)"
;
}
$field
=
$filter
->field;
if
(in_array(
$field
,
$properties
)) {
$index
=
array_search
(
$filter
,
$all
);
$value
=
":filter$index"
;
if
(
$this
->isDate(
$filter
->value)) {
$field
=
"date($field)"
;
$value
=
"date($value)"
;
}
if
(
$this
->isString(
$filter
->value)) {
$operator
=
$this
->stringOperators[
$filter
->operator];
}
else
{
$operator
=
$this
->operators[
$filter
->operator];
}
return
"$field $operator $value"
;
}
}
if
(
$this
->isString(
$filter
->value)) {
$operator
=
$this
->stringOperators[
$filter
->operator];
}
else
{
$operator
=
$this
->operators[
$filter
->operator];
}
private
$stringOperators
=
array
(
'eq'
=>
'LIKE'
,
'neq'
=>
'NOT LIKE'
,
'doesnotcontain'
=>
'NOT LIKE'
,
'contains'
=>
'LIKE'
,
'startswith'
=>
'LIKE'
,
'endswith'
=>
'LIKE'
);
private
$operators
=
array
(
'eq'
=>
'='
,
'gt'
=>
'>'
,
'gte'
=>
'>='
,
'lt'
=>
'<'
,
'lte'
=>
'<='
,
'neq'
=>
'!='
);
{"filter":{"logic":"and","filters":[{"value":"90080800418","operator":"startswith","field":"kh_Imie","ignoreCase":true}]}}