We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我使用的是 2.1.1版 ` using UnityEngine; using XCharts;
public class TestAlignment : MonoBehaviour { public PieChart aPieChart;
void Start() { initAPieChart(); } void initAPieChart() { aPieChart.ClearData(); aPieChart.AddData(0, 105, "数据1"); aPieChart.AddData(0, 132, "数据2"); aPieChart.AddData(0, 116, "数据3"); aPieChart.AddData(0, 94, "数据4"); aPieChart.AddData(0, 121, "数据5"); aPieChart.AddData(0, 52, "数据6"); aPieChart.AddData(0, 189, "数据7"); aPieChart.rectTransform.sizeDelta = new Vector2(1200, 800); aPieChart.series.GetSerie(0).label.show = true; aPieChart.series.GetSerie(0).label.line = true; aPieChart.series.GetSerie(0).label.lineLength1 = 50; aPieChart.series.GetSerie(0).label.textStyle.alignment = TextAnchor.MiddleLeft; aPieChart.series.GetSerie(0).label.formatter = "{b}{b}\n{c}"; aPieChart.series.GetSerie(0).radius = new float[2] { 0f, 200f }; }
} `
aPieChart.series.GetSerie(0).label.textStyle.alignment = TextAnchor.MiddleLeft; 这句设置了左对齐,文字分两行显示,但是依然是居中显示的。
aPieChart.series.GetSerie(0).label.textStyle.alignment = TextAnchor.MiddleLeft;
另外设置柱状图的横轴标签文字的对齐方式也看不到效果: aBarChart.xAxis0.axisLabel.textStyle.alignment = TextAnchor.MiddleRight; 这样设置后,我预期的是一段文字右侧和柱的中心线对齐,但是看到的仍然是一段文字中间和柱的中心线对齐。
aBarChart.xAxis0.axisLabel.textStyle.alignment = TextAnchor.MiddleRight;
谢谢作者开发的图表程序。
The text was updated successfully, but these errors were encountered:
完善TextStyle的alignment的支持 (#150)
TextStyle
alignment
6872d42
master已支持。Release要晚几天再发。 要用textStyle的设置的对齐需要设置autoAlign为false。
Sorry, something went wrong.
7057cce
No branches or pull requests
我使用的是 2.1.1版
`
using UnityEngine;
using XCharts;
public class TestAlignment : MonoBehaviour
{
public PieChart aPieChart;
}
`
aPieChart.series.GetSerie(0).label.textStyle.alignment = TextAnchor.MiddleLeft;
这句设置了左对齐,文字分两行显示,但是依然是居中显示的。
另外设置柱状图的横轴标签文字的对齐方式也看不到效果:
aBarChart.xAxis0.axisLabel.textStyle.alignment = TextAnchor.MiddleRight;
这样设置后,我预期的是一段文字右侧和柱的中心线对齐,但是看到的仍然是一段文字中间和柱的中心线对齐。
谢谢作者开发的图表程序。
The text was updated successfully, but these errors were encountered: