仅在我的测试中获取highchrts系列名称不正确

时间:2015-07-29 03:55:00

标签: javascript highcharts

我有条形图,通过点击不同的系列深入到其他几个图表。我捕获了单击的系列名称以显示钻取中的相应图表。当我在我的UI上手动检查时,它完全按预期工作。我正在使用

this.series.name // to get the series 
this.name // to get the point name 

但我已经编写了用于通过下钻来验证此图表数据的测试用例,这里所有的测试都失败了,因为没有正确获得点击的系列名称,这对我来说很奇怪。

this.series.name // to get the series 
this.name // to get the point name 

这些结果与点名相同,导致我的测试失败。

    plotOptions : {
                series : {
                    point: {
                        events: {
                            click: function() {
                                $("#getid").val(this.name);
                                $("#getseriesname").val(this.series.name);
                                $("#getsome").val($("#given").val());
                                console.log("()()((* " + this.series.name + " *** " + this.name); // results (this.series.name==this.name) only in tests verifying                                                                  
                                chartDrilldown('someotherreport', {
                                    name: 'gettype',
                                    value: $("#getval").val(),
                                });
                            }                           
                        }                       
                    }                   
                }
             },

我不明白为什么在测试中没有获得系列名称。任何人都可以指出我的错误。

0 个答案:

没有答案