mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 17:00:08 +00:00
增加LabelStyle的autoRotate可设置有角度的竖版文本的自动旋转
This commit is contained in:
@@ -96,10 +96,10 @@ namespace XCharts.Runtime
|
||||
return new AxisLabel()
|
||||
{
|
||||
m_Show = true,
|
||||
m_Interval = 0,
|
||||
m_Inside = false,
|
||||
m_Distance = 8,
|
||||
m_TextStyle = new TextStyle(),
|
||||
m_Interval = 0,
|
||||
m_Inside = false,
|
||||
m_Distance = 8,
|
||||
m_TextStyle = new TextStyle(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -168,5 +168,16 @@ namespace XCharts.Runtime
|
||||
}
|
||||
return base.GetFormatterContent(labelIndex, value, minValue, maxValue, isLog);
|
||||
}
|
||||
|
||||
public bool IsNeedShowLabel(int index, int total)
|
||||
{
|
||||
var labelShow = show && (interval == 0 || index % (interval + 1) == 0);
|
||||
if (labelShow)
|
||||
{
|
||||
if (!showStartLabel && index == 0) labelShow = false;
|
||||
else if (!showEndLabel && index == total - 1) labelShow = false;
|
||||
}
|
||||
return labelShow;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user