mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 06:50:18 +00:00
增加3D坐标系对类目轴的支持
This commit is contained in:
@@ -73,10 +73,12 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
* (2024.05.29) 增加`3D`坐标系对类目轴的支持
|
||||
* (2024.05.19) 优化`Editor`下的编辑性能
|
||||
* (2024.05.09) 增加`JsonUtil`工具类
|
||||
* (2024.04.23) 修复`ConvertXYAxis()`多次调用后图表异常的问题
|
||||
* (2024.04.22) 修复`DataZoom`控制多个轴时的`GridCoord`获取可能不正确的问题 (#317)
|
||||
* (2024.04.22) 增加`GridCoord3D`3D坐标系
|
||||
* (2024.04.22) 增加`3D`坐标系
|
||||
* (2024.04.15) 优化`DateTimeUtil`时间戳转`DateTime`接口时区的问题
|
||||
* (2024.04.15) 优化`GridCoord`在开启`GridLayout`时也显示`Left` `Right` `Top` `Bottom`参数 (#316)
|
||||
* (2024.04.14) 修复`Tooltip`的`Cross`在开启`DataZoom`的情况下`label`位置不正确的问题 (#315)
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace XCharts
|
||||
if (axis.IsCategory())
|
||||
{
|
||||
axis.context.minValue = 0;
|
||||
axis.context.maxValue = SeriesHelper.GetMaxSerieDataCount(chart.series) - 1;
|
||||
axis.context.maxValue = axis.data.Count > 0 ? axis.data.Count - 1 : SeriesHelper.GetMaxSerieDataCount(chart.series) - 1;
|
||||
axis.context.minMaxRange = axis.context.maxValue;
|
||||
return;
|
||||
}
|
||||
@@ -373,6 +373,7 @@ namespace XCharts
|
||||
{
|
||||
Axis axis = component;
|
||||
var axisLength = (axis.context.end - axis.context.start).magnitude;
|
||||
if (axisLength == 0) return;
|
||||
chart.InitAxisRuntimeData(axis);
|
||||
|
||||
var objName = ChartCached.GetComponentObjectName(axis);
|
||||
@@ -439,8 +440,6 @@ namespace XCharts
|
||||
|
||||
var pos = GetLabelPosition(totalWidth + gapWidth, i);
|
||||
label.SetPosition(pos);
|
||||
//CheckValueLabelActive(axis, i, label, pos);
|
||||
|
||||
axis.context.labelObjectList.Add(label);
|
||||
|
||||
totalWidth += labelWidth;
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace XCharts.Runtime
|
||||
if (axis.splitNumber <= 0)
|
||||
{
|
||||
var eachWid = coordinateWid / dataCount;
|
||||
var min = axis is YAxis ? 20 : 80;
|
||||
var min = ((axis is YAxis) || (axis is ZAxis3D)) ? 20 : 80;
|
||||
if (eachWid > min) return dataCount;
|
||||
var tick = Mathf.CeilToInt(min / eachWid);
|
||||
return tick <= 1 ? dataCount : (int)(dataCount / tick);
|
||||
|
||||
@@ -11,16 +11,24 @@ namespace XCharts.Runtime
|
||||
public virtual void GetSeriesMinMaxValue(Axis axis, int axisIndex, out double tempMinValue, out double tempMaxValue)
|
||||
{
|
||||
var needAnimationData = !axis.context.needAnimation;
|
||||
if (IsAllAxisValue())
|
||||
if (axis is XAxis3D)
|
||||
{
|
||||
if (axis is XAxis || axis is XAxis3D)
|
||||
SeriesHelper.GetXMinMaxValue(this, axisIndex, axis.inverse, out tempMinValue, out tempMaxValue, false, false, needAnimationData);
|
||||
}
|
||||
else if (axis is ZAxis3D)
|
||||
{
|
||||
SeriesHelper.GetZMinMaxValue(this, axisIndex, axis.inverse, out tempMinValue, out tempMaxValue, false, false, needAnimationData);
|
||||
}
|
||||
else if (axis is YAxis3D)
|
||||
{
|
||||
SeriesHelper.GetYMinMaxValue(this, axisIndex, axis.inverse, out tempMinValue, out tempMaxValue, false, false, needAnimationData);
|
||||
}
|
||||
else if (IsAllAxisValue())
|
||||
{
|
||||
if (axis is XAxis)
|
||||
{
|
||||
SeriesHelper.GetXMinMaxValue(this, axisIndex, axis.inverse, out tempMinValue, out tempMaxValue, false, false, needAnimationData);
|
||||
}
|
||||
else if (axis is ZAxis3D)
|
||||
{
|
||||
SeriesHelper.GetZMinMaxValue(this, axisIndex, axis.inverse, out tempMinValue, out tempMaxValue, false, false, needAnimationData);
|
||||
}
|
||||
else
|
||||
{
|
||||
SeriesHelper.GetYMinMaxValue(this, axisIndex, axis.inverse, out tempMinValue, out tempMaxValue, false, false, needAnimationData);
|
||||
|
||||
Reference in New Issue
Block a user