1
votes

I'm trying to create chart using Dojox charting. I created plot and added Series.

this.addPlot("st", {type: Lines, markers: false, tension:"X"});

this.addSeries("Series A",
               [{x:0, y:0}, {x:5, y:10},
                {x:10, y:12}, {x:15, y:14},
                {x:20, y:15}, {x:25, y:16},
                {x:30, y:18}],
               {plot: "st"});

Then I added MouseIndicator

new MouseIndicator (this, "st",
             {series: "Series A",
              labels: false,
              mouseOver: true,
              lineStroke: { color: "blue" }   
             });

So it has added indicator but with default colors. Tried to change indicator with lineStroke, lineOutline or lineShadow. Nothing changed.

According to API docs it should change the line style^ http://bill.dojotoolkit.org/api/1.9/dojox/charting/action2d/MouseIndicator

Does anybody knows how to change MouseIndicator line style?

1

1 Answers

0
votes

Here is my Hack of a solution.

Using dojo/aspect (http://dojotoolkit.org/reference-guide/1.10/dojo/aspect.html) to listen on the "_onMouseSingle" of the MouseIndicator object, and after this event occurs, change the marker and line stroke colors:

var mouseHoverIndicator = new MouseIndicator (this, "st",{
        series: "Series A",
        labels: false,
        mouseOver: true,
        lineStroke: { color: "blue" }   
    });

aspect.after(mouseHoverIndicator, "_onMouseSingle", function (value) {
    var plot = mouseHoverIndicator.chart.getPlot(mouseHoverIndicator._uName);
    plot.opt.markerStroke=  {color:"blue"};
    plot.opt.lineStroke= {color:"blue"};
    plot.dirty = true;
    mouseHoverIndicator.chart.render();
});