This is a migrated thread and some comments may be shown as answers.

XAxis labels as strings for a Bubble chart

1 Answer 91 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Arek
Top achievements
Rank 1
Arek asked on 04 Sep 2013, 03:10 PM
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

1 Answer, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 06 Sep 2013, 11:41 AM
Hi Arek,

Could you give me a sample project that reproduce this issue and I will do my best to resolve your issue. Thank you for the understanding.

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Arek
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Share this question
or