This commit is contained in:
monitor1394
2022-05-22 22:17:38 +08:00
parent 003f4da9de
commit bafe032bb9
391 changed files with 3718 additions and 2774 deletions

View File

@@ -1,4 +1,3 @@
using System.Collections.Generic;
using UnityEngine;
@@ -87,15 +86,15 @@ namespace XCharts.Runtime
if (m_Orient == Orient.Horizonal)
{
context.width = width == 0
? chartWidth - context.left - context.right
: (width <= 1 ? chartWidth * width : width);
context.width = width == 0 ?
chartWidth - context.left - context.right :
(width <= 1 ? chartWidth * width : width);
}
else
{
context.width = width == 0
? chartHeight - context.top - context.bottom
: (width <= 1 ? chartHeight * width : width);
context.width = width == 0 ?
chartHeight - context.top - context.bottom :
(width <= 1 ? chartHeight * width : width);
}
if (context.left != 0 && context.right == 0)

View File

@@ -1,4 +1,3 @@
using UnityEngine;
using UnityEngine.UI;
@@ -32,14 +31,14 @@ namespace XCharts.Runtime
var theme = chart.theme;
var xAxisIndex = axis.index;
axis.painter = chart.painter;
axis.refreshComponent = delegate ()
axis.refreshComponent = delegate()
{
axis.UpdateRuntimeData(chart.chartX,
chart.chartY,
chart.chartWidth,
chart.chartHeight);
InitAxis(axis, null, chart, this,
InitAxis(null,
axis.orient,
axis.context.x,
axis.context.y,
@@ -83,7 +82,7 @@ namespace XCharts.Runtime
if (AxisHelper.NeedShowSplit(axis))
{
var dataZoom = chart.GetDataZoomOfAxis(axis);
DrawAxisSplit(vh, axis, chart.theme.axis, dataZoom,
DrawAxisSplit(vh, chart.theme.axis, dataZoom,
axis.orient,
axis.context.x,
axis.context.y,
@@ -109,14 +108,18 @@ namespace XCharts.Runtime
{
if (axis.show && axis.axisLine.show)
{
var axisStartY = axis.context.y + axis.offset;
DrawAxisLine(vh, axis,
chart.theme.axis,
axis.orient,
axis.context.x,
axisStartY,
GetAxisLineXOrY(),
axis.context.width);
}
}
protected override float GetAxisLineXOrY()
{
return component.context.y + component.offset;
}
}
}