【问题标题】:Kendo UI Bar Chart - pan and zoom not working?Kendo UI 条形图 - 平移和缩放不起作用?
【发布时间】:2016-04-11 19:50:14
【问题描述】:

我的条形图在一个窗口内。当窗口打开时,图表已创建,但可缩放和可平移选项不起作用?任何想法为什么?我的数据源链接到一个对象数组变量。

$("#chart").kendoChart({
    pannable: {
        lock: "y"
    },
    zoomable: {
        mousewheel: {
            lock: "y"
        },
        selection: {
            lock: "y"
        }
    },
    dataSource: dsSales,
    title: {
        text: "Sales Analysis"
    },
    legend: {
        position: "top",
        visible: true
    },
    tooltip: {
        visible: true,
        template: "#= series.name # : #= value # (#= dataItem.month #)"
    },
    seriesDefaults: {
        type: pcChartType
    },
    series: [
        {field:"OrderQty", name:"Order Qty", colorField:"useColorQty"},
        {field:"OrderValue", name:"Order Value", colorField:"useColorValue"},
    ],
    categoryAxis: {
        field:"month",
        majorGridLines: {
            visible: true
        }
    },
    valueAxis: {
        minorGridLines: {
            visible: true
        }
    },
    dataBound: function(e){

    }
}).data("kendoChart");

【问题讨论】:

    标签: kendo-ui bar-chart kendo-dataviz


    【解决方案1】:

    Kendo UI 图表上的平移和缩放功能是一项新功能,在撰写本文时,该功能最近才在所有图表上提供。如果您使用的是最新版本的 Kendo UI,例如 v2016.1.112,那么您的示例无疑可以正常工作,因为您为此提供了正确的配置:

      $("#chart").kendoChart({
            renderAs: "canvas",
            // ... other stuff here
            pannable: {
                lock: "y"
            },
            zoomable: {
                mousewheel: {
                    lock: "y"
                },
                selection: {
                    lock: "y"
                }
            }
        }); 
    

    如果没有可重现的样本(尤其是来自 dsSales 的数据),这很难进一步分析。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-08
      • 1970-01-01
      相关资源
      最近更新 更多