如何只在剑道股票图表工具提示中获取日期和时间

时间:2013-09-04 09:58:48

标签: kendo-ui

亥,                        我已经配置了剑道股票图表。因为我遇到了工具提示的问题。如何获得自定义工具提示日期如1/2/2012 3:12:13

function createChart() {
            $("#stock-chart").kendoStockChart({
                dataSource: {
                    serverFiltering: true,
                    transport: {
                        read: {
                            url: "http://demos.kendoui.com/service/StockData",
                            dataType: "jsonp"
                        },
                        parameterMap: function(data) {
                            return { filter: JSON.stringify(data.filter) };
                        }
                    },
                    schema: stockDataSchema
                },
                title: {
                    text: "The ACME Company"
                },
                dateField: "Date",
                series: [{
                    type: "column",
                    field: "Open"

                }],
               tooltip: {
                visible: true,
                 template: "Time:${category} - Mode:${value}"

        },
                navigator: {
                    dataSource: {
                        transport: {
                            read: {
                                url: "http://demos.kendoui.com/service/StockData",
                                dataType: "jsonp"
                            }
                        },
                        schema: stockDataSchema
                    },
                    series: {
                        type: "column",
                        field: "High"
                    },
                    select: {
                        from: "2009/02/05",
                        to: "2011/10/07"
                    }
                }
            });
        }

        $(document).ready(createChart);
        $(document).bind("kendo:skinChange", createChart);

这是工作的Js小提琴:http://jsbin.com/ilemel/54/edit

1 个答案:

答案 0 :(得分:3)

试试这个,

演示:http://jsbin.com/ilemel/56/edit

tooltip: {
                visible: true,
                 template: "Time:#= kendo.format('{0:dd/MM/yyyy}',category) # - Mode:${value}"

        },