当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - highchart drilldown dynamic point name

问题描述:

 events: {

drilldown: function (e) {

if (!e.seriesOptions) {

var Fruitsname= e.point.name;

//var Fruitsname='Fruits';

drilldowns = {

Fruitname:{

// 'Fruits': {

name: 'Fruits',

data: [

['Apples', 5],

['Oranges', 7],

['Bananas', 2]

]

},

}

}

}

}

I got click event on drill down using e.point.name, but string name under drill down is taking as in double quotation but it required string in single quote .

I tried using alert and console.log but it is showing without quotes,In breakpoints it showing in double quotes.I have commented line 'Fruits' it works as static value.

can any one knows how to bind point name to drill down.

Any suggestion or help will be appreciated

thanks in advance..

网友答案:

Try this way:

drilldowns = {};
drilldowns[Fruitname] = {
      name: 'Fruits',
      data: [
      ['Apples', 5],
      ['Oranges', 7],
      ['Bananas', 2]
        ]
 }
分享给朋友:
您可能感兴趣的文章:
随机阅读: