【问题标题】:Dojox Charting. Cannot change indicator line style of MouseIndicatorDojox 图表。无法更改 MouseIndicator 的指示线样式
【发布时间】:2016-11-08 10:33:07
【问题描述】:

我正在尝试使用 Dojox 图表创建图表。我创建了情节并添加了系列。

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"});

然后我添加了鼠标指示器

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

所以它添加了指示器,但具有默认颜色。 尝试使用 lineStroke、lineOutline 或 lineShadow 更改指标。没有任何改变。

根据 API 文档,它应该改变线条样式^ http://bill.dojotoolkit.org/api/1.9/dojox/charting/action2d/MouseIndicator

有人知道如何更改鼠标指示器的线条样式吗?

【问题讨论】:

    标签: dojo dojox.charting


    【解决方案1】:

    这是我的解决方案。

    使用dojo/aspect(http://dojotoolkit.org/reference-guide/1.10/dojo/aspect.html)监听MouseIndicator对象的“_onMouseSingle”,在这个事件发生后,改变marker和line stroke的颜色:

    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();
    });
    

    【讨论】:

      猜你喜欢
      • 2014-12-20
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 2021-10-22
      • 2014-08-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多