javascript - Angular nvd3 donut chart - how to add a static or dynamic title? - -


i using angular nvd3-pie-chart. idea or suggestion how add static or dynamic title @ center of donut chart?

here code block.

 <nvd3-pie-chart      data="exampledata" id="exampleid" showlabels="true" x="xfunction()" y="yfunction()" donut="true" donutratio=".5" donutlabelsoutside="true">  </nvd3-pie-chart>  function examplectrl($scope){             $scope.exampledata = [                 {                     key: "one",                     y: 5                 },                 {                     key: "two",                     y: 2                 }             ];              $scope.xfunction = function(){                 return function(d) {                     return d.key;                 };             }             $scope.yfunction = function(){                 return function(d) {                     return d.y;                 };             }          } 

you can use below:

title: { enable: true, text: 'chart title' } 

refer below link: nvd3 docs


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -