0

Any idea how to add charts using Telerik Kendo UI DataViz to an iPhone web application. Thanks in advance. Here is what I am trying to do, but the chart does not show up!

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
    <script src="../../../../Scripts/jquery.min.js" type="text/javascript"></script>
    <script src="../../../../Scripts/kendo.all.js" type="text/javascript"></script>
    <script src="../../../../Scripts/console.js" type="text/javascript"></script>
    <link href="../../../../Content/Mobile/kendo.common.min.css" rel="stylesheet" type="text/css" />
    <link href="../../../../Content/Mobile/kendo.mobile.all.min.css" rel="stylesheet"
        type="text/css" />

    <div data-role="view" data-title="Views">
    <header data-role="header">
        <div data-role="navbar">
            <span data-role="view-title"></span>
            <a data-align="right" data-role="button" class="nav-button" href="#index">Index</a>
        </div>
    </header>
    <ul data-role="listview" data-style="inset">
        <li><a href="#secondview">Local View</a></li>
    </ul>
    <ul data-role="listview" data-style="inset">
        <li><a href="../../content/mobile/view/remoteview.html">Remote View</a></li>
    </ul>
</div>

<div data-role="view" id="secondview" data-layout="mobile-view" data-title="Local View">
  <div id="chart">
        </div>
        <script>
            function createChart() {
                $("#chart").kendoChart({
                    title: {
                        text: "Kendo Chart Example"
                    },
                    series: [
         { name: "Example Series", data: [200, 450, 300, 125] }
    ]
                });
            }

            $(document).ready(function () {
                setTimeout(function () {

                    createChart();

                    $("#example").bind("kendo:skinChange", function (e) {
                        createChart();
                    });
                }, 400);
            });
        </script>
</div>

<div data-role="layout" data-id="mobile-view">
    <header data-role="header">
        <div data-role="navbar">
            <a class="nav-button" data-align="left" data-role="backbutton">Back</a>
            <span data-role="view-title"></span>
            <a data-align="right" data-role="button" class="nav-button" href="#index">Index</a>
        </div>
    </header>
</div>


    <script>
        window.kendoMobileApplication = new kendo.mobile.Application(document.body);
    </script>

Thanks in advance

kmp
  • 10,535
  • 11
  • 75
  • 125
hncl
  • 2,295
  • 7
  • 63
  • 129

1 Answers1

0

KendoUI DataViz components work in Webkit-based mobile browsers, including Safari on iOS (source), in addition to Android Browser v3 and above.

If you just want to know how to implement a KendoUI chart, here is a simple one I did to answer another question, about how to force KendoUI to plot across missing values: http://jsfiddle.net/LyndsySimon/KJuDe/

categoryAxis: {
    categories: [
        'test<tspan dx="-20px" dy="1em">label</tspan>', 2006, 2007, 2008, 2009]
}

You can find a complete reference to the DataViz library on KendoUI's site: http://www.kendoui.com/documentation/dataviz/chart/overview.aspx

Lyndsy Simon
  • 5,208
  • 1
  • 17
  • 21
  • Thank you Lyndsy, I just edited my question with the code I am trying to use. Could it be running $(document).ready is the problem? – hncl Apr 19 '12 at 15:34
  • It worked, I also found this solution for Android.http://www.kendoui.com/blogs/teamblog/posts/12-02-17/using_svg_on_android_2_x_and_kendo_ui_dataviz.aspx – hncl Apr 20 '12 at 04:57