dojo - Dojox Charting. Cannot change indicator line style of MouseIndicator -
i'm trying create chart using dojox charting. created plot , 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 added mouseindicator
new mouseindicator (this, "st", {series: "series a", labels: false, mouseover: true, linestroke: { color: "blue" } });
so has added indicator default colors. tried change indicator linestroke, lineoutline or lineshadow. nothing changed.
according api docs should change line style^ http://bill.dojotoolkit.org/api/1.9/dojox/charting/action2d/mouseindicator
does knows how change mouseindicator line style?
here hack of solution.
using dojo/aspect (http://dojotoolkit.org/reference-guide/1.10/dojo/aspect.html) listen on "_onmousesingle" of mouseindicator object, , after event occurs, change marker , 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(); });
Comments
Post a Comment