Hello,
I'm using Kendo UI MVC (the latest build as of 9/4/2013).
I have problems setting the XAxis lables to strings that represent dates in my database.
The Json that I feed to the chart has MediaWeek as string date that is the XAxis label.
[
{
"Id": 1,
"ClientCode": "JKLN",
"ProductCode": "YYYY",
"MediaWeek": "2012-12-31",
"Spend": 3165,
"Visits": 5704,
"Orders": 422,
"Revenue": 5774.29,
"Cpv": 1.59,
"Vpk": 717,
"Mer": 0.92,
"Conversion": 0.59
},
....
]
The View looks like that:
@(Html.Kendo().Chart<ContinuumData>()
.Name("chart")
.Legend(false)
.HtmlAttributes(new {style = "height:235px;width:691px;"})
.DataSource(ds => ds.Read(read => read.Action("Data_Read_Chart", "Continuum")))
.Series(series => series.Bubble(
model => model.MediaWeek,
model => model.Revenue,
model => model.Mer,
model => model.ClientCode
))
.XAxis(axis => axis
.Date()
.Labels(labels => labels
.Format("{0:MM/dd/yyyy}")))
.YAxis(axis => axis
.Numeric()
.Labels(labels => labels
.Format("{0:N0}")
)
.Line(line => line
.Width(0)
)
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{3}: {2:N0} MER")
.Opacity(1)
)
.Theme("Moonlight")
)
I also attached the screenshot of the chart with all bubbles clumped at 0 for the XAxis...
I could also change the type of the MediaWeek to DateTime if that helps....
If you guys could guide me I would be very grateful.
Thanks,
-Arek
I'm using Kendo UI MVC (the latest build as of 9/4/2013).
I have problems setting the XAxis lables to strings that represent dates in my database.
The Json that I feed to the chart has MediaWeek as string date that is the XAxis label.
[
{
"Id": 1,
"ClientCode": "JKLN",
"ProductCode": "YYYY",
"MediaWeek": "2012-12-31",
"Spend": 3165,
"Visits": 5704,
"Orders": 422,
"Revenue": 5774.29,
"Cpv": 1.59,
"Vpk": 717,
"Mer": 0.92,
"Conversion": 0.59
},
....
]
The View looks like that:
@(Html.Kendo().Chart<ContinuumData>()
.Name("chart")
.Legend(false)
.HtmlAttributes(new {style = "height:235px;width:691px;"})
.DataSource(ds => ds.Read(read => read.Action("Data_Read_Chart", "Continuum")))
.Series(series => series.Bubble(
model => model.MediaWeek,
model => model.Revenue,
model => model.Mer,
model => model.ClientCode
))
.XAxis(axis => axis
.Date()
.Labels(labels => labels
.Format("{0:MM/dd/yyyy}")))
.YAxis(axis => axis
.Numeric()
.Labels(labels => labels
.Format("{0:N0}")
)
.Line(line => line
.Width(0)
)
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{3}: {2:N0} MER")
.Opacity(1)
)
.Theme("Moonlight")
)
I also attached the screenshot of the chart with all bubbles clumped at 0 for the XAxis...
I could also change the type of the MediaWeek to DateTime if that helps....
If you guys could guide me I would be very grateful.
Thanks,
-Arek