NVD3 noData text color change

混江龙づ霸主 提交于 2019-12-25 03:04:11

问题


I am using nvd3 line chart and customize the text of noData. Now i need to update the color of the text and want text underline. I have updated the css with below changes.

text.nvd3.nv-noData{
    color:"yellow";
    text-decoration: underline;
}

however, text-decoration works perfectly but color is not getting change.

I have changed fill value of svg text but it will change the text color of all the text including axis lable values.

Can someone pls help me with this ?


回答1:


You need to use fill instead of color and yellow without quotes:

text.nvd3.nv-noData{
  fill: yellow;
  text-decoration: underline;
}



回答2:


This is the way to change the Color or text of NoData:

lang:
{

  noData: "My custom Text",

},
noData: {
    style: {
        fontWeight: 'bold',
        fontSize: '15px',
        color: '#eeeeee'
    }
}


来源:https://stackoverflow.com/questions/33022641/nvd3-nodata-text-color-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!