I'm having trouble setting the range of an axis so that the minimum is below 1. I understand that no value less than 0 can be plotted by I don't understand why values below 1 cannot be viewed unless I can pan to them. Is there any reason for this? Or a way of resolving it?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
While this may be as designed, you could still achieve the affect you're looking for by scaling your data up into the valid range for the logarithmic axis. Then you could override the label function to set the labels you want. It's hacky, but it might work for your needs.
class MyLogarithmicAxis : LogarithmicAxis
{
protected override string GetFormattedDataValueInternal(double dataValue, string formatString)
{
if (dataValue == 1)
{
dataValue = .1;
}
if (dataValue == 100)
{
dataValue = 10;
}
if (dataValue == 1000)
{
dataValue = 100;
}
return base.GetFormattedDataValueInternal(dataValue, formatString);
}
}