问题
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