mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 09:50:15 +00:00
Improved Axis's AxisLabel text rotate setting to avoid inconsistency offset in DataZoom (#163)
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2021.08.15) Improved `Axis`'s `AxisLabel` text rotate setting to avoid inconsistency offset in `DataZoom` (#163)
|
||||||
* (2021.08.14) Added `Legend`'s `textAutoColor` to set the text color match with `Serie` color (#163)
|
* (2021.08.14) Added `Legend`'s `textAutoColor` to set the text color match with `Serie` color (#163)
|
||||||
* (2021.08.12) Optimize `BarChart` setting `Corner` when the positive and negative columns are fillet symmetric
|
* (2021.08.12) Optimize `BarChart` setting `Corner` when the positive and negative columns are fillet symmetric
|
||||||
* (2021.08.03) Fixed y axis not displaying when all data is 0
|
* (2021.08.03) Fixed y axis not displaying when all data is 0
|
||||||
|
|||||||
@@ -39,7 +39,8 @@
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
* (2021.08.14) 增加`Legend`的`textAutoColor`设置文本颜色和`Serie`一致
|
* (2021.08.15) 优化`Axis`的`AxisLabel`文本旋转设置,避免在DataZoom开启时偏移不一致 (#163)
|
||||||
|
* (2021.08.14) 增加`Legend`的`textAutoColor`设置文本颜色和`Serie`一致 (#163)
|
||||||
* (2021.08.12) 优化`BarChart`设置`Corner`时正负柱条圆角对称
|
* (2021.08.12) 优化`BarChart`设置`Corner`时正负柱条圆角对称
|
||||||
* (2021.08.03) 优化`Serie`的数据全为0时Y轴不显示的问题
|
* (2021.08.03) 优化`Serie`的数据全为0时Y轴不显示的问题
|
||||||
* (2021.07.29) 修复`Serie`开启`ignore`时被忽略的数据还会参与计算的问题 (#161)
|
* (2021.07.29) 修复`Serie`开启`ignore`时被忽略的数据还会参与计算的问题 (#161)
|
||||||
|
|||||||
@@ -728,12 +728,12 @@ namespace XCharts
|
|||||||
var labelName = AxisHelper.GetLabelName(xAxis, grid.runtimeWidth, i, xAxis.runtimeMinValue,
|
var labelName = AxisHelper.GetLabelName(xAxis, grid.runtimeWidth, i, xAxis.runtimeMinValue,
|
||||||
xAxis.runtimeMaxValue, dataZoom, isPercentStack);
|
xAxis.runtimeMaxValue, dataZoom, isPercentStack);
|
||||||
var label = ChartHelper.AddAxisLabelObject(splitNumber, i, ChartCached.GetXAxisName(xAxisIndex, i),
|
var label = ChartHelper.AddAxisLabelObject(splitNumber, i, ChartCached.GetXAxisName(xAxisIndex, i),
|
||||||
axisObj.transform, new Vector2(0, 1), new Vector2(0, 1), new Vector2(1, 0.5f),
|
axisObj.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f),
|
||||||
new Vector2(textWidth, textHeight), xAxis, theme.axis, labelName);
|
new Vector2(textWidth, textHeight), xAxis, theme.axis, labelName);
|
||||||
|
|
||||||
if (i == 0) xAxis.axisLabel.SetRelatedText(label.label, labelWidth);
|
if (i == 0) xAxis.axisLabel.SetRelatedText(label.label, labelWidth);
|
||||||
label.label.SetAlignment(axisLabelTextStyle.GetAlignment(TextAnchor.MiddleCenter));
|
label.label.SetAlignment(axisLabelTextStyle.GetAlignment(TextAnchor.MiddleCenter));
|
||||||
label.SetPosition(GetLabelXPosition(totalWidth + textWidth / 2 + gapWidth, i, xAxisIndex, xAxis));
|
label.SetPosition(GetLabelXPosition(totalWidth + gapWidth, i, xAxisIndex, xAxis));
|
||||||
xAxis.runtimeAxisLabelList.Add(label);
|
xAxis.runtimeAxisLabelList.Add(label);
|
||||||
totalWidth += labelWidth;
|
totalWidth += labelWidth;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user