[JS] function datalabelRendering(sender) { //displayTextRendering event triggered { var inputValue = sender.data.text; var format = "c"; var culture = Globalize.cultures.eu; var value = Globalize.format(inputValue,format,culture); var p = $("#euroSymbol")[0]; sender.data.text = value.replace(culture.numberFormat.currency.symbol,p.textContent); } |
[JS] displayTextRendering: function (args) { var inputValue = args.model.series[args.data.seriesIndex]._visiblePoints[args.data.pointIndex].y; }, |
[JS] $(function () { $("#container").ejChart({ pointRegionMouseMove:function(args) // pointRegionMouseMove event triggered when hover on point { window.pointClick = true; }, chartMouseMove:function(args) //chartMouseMove event tiggered when move the mouse on chart area { var chart = $("#container").ejChart("instance"); //To get the chart instance if(window.pointClick){ for(var i=0;i<args.model.series.length;i++) { for(var j=0;j<args.model.series[i].points.length;j++) { var check ="container_svg_Series"+i+"_Point"+j+"_symbol"; if(args.data.id == check){ //checking that whether mouse hover on point var clearID = check; chart.model.series[i].points[j].marker.dataLabel.visible=true; window.flag =chart.model.series[i].points[j].marker.dataLabel.visible; window.seriesIndex = i; window.pointIndex = j; chart.redraw(); window.pointClick = false; } } } } if(args.data.id != clearID && window.flag) //To remove the datalabel when mouse move from the particular point { chart.model.series[window.seriesIndex].points[window.pointIndex ].marker.dataLabel.visible=false; chart.redraw(); } }, displayTextRendering: function (args) { //To covert the normal number to currency based on culture var inputValue = args.model.series[args.data.seriesIndex]._visiblePoints[args.data.pointIndex].y; var format = "c"; var culture = Globalize.cultures.eu; var value = Globalize.format(inputValue, format, culture); args.data.text = value; }, }); }); |