There are now two methods for doing this.The newer method, available since Wijmo 2013, uses wijmo.ChartTooltip.animations.
Note: The default value for the hint option's animated attribute is "fade." To use any other, you must create a custom animation. You can set the hideAnimated and showAnimated attributes to use different animations, or set them to null so that they default to the value you assign to animated.
Drop down and copy code
Customize Tooltip Animation Script |
Copy Code |
---|---|
<script id="scriptInit" type="text/javascript"> $(document).ready(function () { $("#wijbubblechart").wijbubblechart({ axis: { y: {text: "Number of Products"}, x: {text: "Sales", annoFormatString: "C0"} }, hint: { animated: "scale", hideAnimated: null, showAnimated: null }, legend: {visible: false}, seriesList: [ { label: "Company A Market Share", data: { y: [14], x: [12200], y1: [.15] } }, { label: "Company B Market Share", data: { y: [20], x: [60000], y1: [.23] } }, { label: "Company C Market Share", data: { y: [18], x: [24400], y1: [.1] } }] }); Raphael.fn.tooltip.animations.scale = function (options) { context = options.context, bBox = context.wijGetBBox(), w = bBox.width, h = bBox.height; if (options.show) { scaleSet(context, options.duration, options.easing); } else { context.wijAnimate({ "transform": "...s0" }, options.duration, options.easing); } } function scaleSet(set, duration, easing) { $.each(set, function (i, s) { if (s.type === "set") { scaleSet(s, duration, easing); } else { var transform = s.attr("transform"); s.wijAttr("transform", "...s0"); s.wijAnimate({ "transform": transform }, duration, easing); } }); } }); </script> |
Drop down and copy code for Wijmo v3 2013+
Customize Tooltip Animation Script |
Copy Code |
---|---|
<script id="scriptInit" type="text/javascript"> $(document).ready(function () { $("#wijbubblechart").wijbubblechart({ axis: { y: {text: "Number of Products"}, x: {text: "Sales", annoFormatString: "C0"} }, hint: { animated: "scale", hideAnimated: null, showAnimated: null }, legend: {visible: false}, seriesList: [ { label: "Company A Market Share", data: { y: [14], x: [12200], y1: [.15] } }, { label: "Company B Market Share", data: { y: [20], x: [60000], y1: [.23] } }, { label: "Company C Market Share", data: { y: [18], x: [24400], y1: [.1] } }] }); wijmo.ChartTooltip.animations.scale = function (options) { context = options.context, bBox = context.wijGetBBox(), w = bBox.width, h = bBox.height; if (options.show) { scaleSet(context, options.duration, options.easing); } else { context.wijAnimate({ "transform": "...s0" }, options.duration, options.easing); } } function scaleSet(set, duration, easing) { $.each(set, function (i, s) { if (s.type === "set") { scaleSet(s, duration, easing); } else { var transform = s.attr("transform"); s.wijAttr("transform", "...s0"); s.wijAnimate({ "transform": transform }, duration, easing); } }); } }); </script> |