This is a migrated thread and some comments may be shown as answers.

Interaction between Crosshair and plotAreaClick event

3 Answers 39 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Karl-Heinz
Top achievements
Rank 1
Karl-Heinz asked on 03 Mar 2014, 11:40 AM
Hello,

I would like to create a line chart with a visible crosshair and an event handler for plotAreaClick. The event handler is needed to process the data point category (event data: e.category). The event is not fired if the mouse pointer touches the crosshair.

Is there a similar event for clicking the crosshair which provides the category – or any other solution for this problem?

3 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 05 Mar 2014, 04:16 PM
Hi Karl-Heinz,

I tried to reproduce the problem - to no avail. Could you please examine my jsBin and modify to reproduce your issues so I will be able to better assist you?

Regards,
Hristo Germanov
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

0
Karl-Heinz
Top achievements
Rank 1
answered on 06 Mar 2014, 09:26 AM
Dear Hristo,

​Many thanks for the answer. Your jsBin contains the following script tag for the JavaScript file kendo.all.min.js:​


Using this tag in my chart solves the problem; the plotAreaClick event is always fired. It seems that the behavior of my program depends on the file version.

The following code shows the set-up of my test page:

 
<head>
    <title></title>
 
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/kendo.all.min.js" type="text/javascript"></script>
    <link href="styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
    <div id="chart"></div>
    <script type="text/javascript">
        $("#chart").kendoChart({
            categoryAxis: {
                categories: ["2012", "2013", "2014"],
                crosshair: {
                    color: "#FF0000",
                    width: 7,
                    visible: true,
                    tooltip: {
                        background: "#F5F5DC",
                        border: {
                            color: "#000000",
                            width: 1
                        },
                        visible: true
                    }
                }
            },
            series: [{
                type: "line",
                data: [1, 2, 3]
            }],
            plotAreaClick: function() {alert('click');}
        });       
    </script>
</body>
 
</html>

When I use the kendo.all.min.js file which is included in kendoui.complete.2013.3.1324.commercial, the plotAreaClick event is not fired correctly. But there is no error if the test page is based on the kendo.all.min.js file which is included in kendoui.complete.2013.2.716.trial.

Did I miss to add additional script tags?


0
Hristo Germanov
Telerik team
answered on 10 Mar 2014, 10:07 AM
Hello Karl-Heinz,

The issue is fixed and the fix will be included with the next official release of Kendo UI scheduled for the next week.

I have updated your points.

Regards,
Hristo Germanov
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Tags
Charts
Asked by
Karl-Heinz
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Karl-Heinz
Top achievements
Rank 1
Share this question
or