views:

15

answers:

1

I'm trying to build a chart which draws a vertical line to the X axis under the cursor. Using this as a guideline:

http://dojo-toolkit.33424.n3.nabble.com/Charting-events-td40659.html

I am using the following code to catch 'mouseout' & 'mousemove' for the chart plot area (excludes the chart margins and labels)

        chart = new dojox.charting.Chart2D("rating");
        chart.addPlot("default", {
            type: "Bubble"
        });

        chart.addPlot("grid", {
            type: "Grid",
            hMinorLines: true
        });

        var plotArea = chart.surface.rawNode.children[1];
        dojo.connect(plotArea, "onmousemove", this, this.showRatingHighlight);
        dojo.connect(plotArea, "onmouseout", this, this.hideRatingHighlight);

Generally, it works as expected. however I also have a grid drawn on the chart, and whenever the mouse passes over the grid lines, I get a "mouseout" event. I also lose the mousemove event when the mouse passes over a marker with a toolTip/highlight action in place.

Q: How can I catch mousemove/mousemove over the 'plotArea' without losing it over the gridlines or plot Markers?

Q: Is there a better way to get the 'plotArea' of the chart for calculating offsets?

A: 
Eugene Lazutkin