문제

I want to get rid of the silly tooltip animation that slides the tooltip from one bar to another. It updates the tooltip instantly but lingers on the previous bar. I have tried the documenations transitions property on both the chart and the tooltip and neither has an affect.

$('.chart').kendoChart({
    transitions: false,
    series: [{
        name: "Gold Medals",
        data: [current.data("compliant-count")],
        color: "#f3ac32"
    }, {
        name: "Silver Medals",
        data: [current.data("noncompliant-count")],
        color: "#b8b8b8"
    },
    tooltip: {
         visible: true,
         template: "#= series.name #: #= value #",
         transitions: false
    }
});
도움이 되었습니까?

해결책

I think the transitions configuration option only applies to the chart itself (bars etc.). You can disable the animation for the tooltip like this:

var chart = $('#chart').kendoChart({
    transitions: false,
    series: [{
        name: "Gold Medals",
        data: [current.data("compliant-count")],
        color: "#f3ac32"
    }, {
        name: "Silver Medals",
        data: [current.data("noncompliant-count")],
        color: "#b8b8b8"
    },
    tooltip: {
         visible: true,
         template: "#= series.name #: #= value #"
    }
}).data("kendoChart");
chart._tooltip.options.animation.duration = 0;

(demo)

You can achieve the same for all chart tooltips by changing the default options before creating the charts:

kendo.dataviz.Tooltip.fn.options.animation.duration = 0;

Completely eliminating the effect of the content changing before the tooltip is moved would require changes in the source code of kendo.dataviz.Tooltip.

다른 팁

I've just come by the same issue, and discovered that simply adding

animation: {
  duration: 0
}

under the tooltip section of the chart config does the job

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top