Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143109 | Mar 5,2019 11:52 AM UTC | Mar 20,2019 11:53 AM UTC | ASP.NET Core - EJ 2 | 6 |
![]() |
Tags: Charts |
function chartMouseClick(args) {
if (((args.target).indexOf('chart_legend_text') > -1))….. {
var chart1 = document.getElementById("container").ej2_instances[0];
chart1.series[0].fill = "red";
chart1.series[1].fill = "blue";
chart1.refresh();
}
} |
Before Click |
After Click |
|
|
<ejs-chart id="container1" chartMouseClick="chartMouseClick">
</ejs-chart>
function chartMouseClick(args) {
console.log(args.target);
}
|
<ejs-chart chartMouseClick="chartMouseClick">
</ejs-chart>
function chartMouseClick(args) {
if (((args.target).indexOf('chart_legend_shape') > -1) ||
(args.target).indexOf('chart_legend_shape_marker_') > -1) {
//Shown the color here
alert(document.getElementById(args.target).getAttribute("fill"));
} else if ((args.target).indexOf('chart_legend_text')> -1) {
//Shown the text here
alert(document.getElementById(args.target).innerHTML);
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.