mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 23:10:06 +00:00
3.0
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -32,13 +31,13 @@ namespace XCharts.Runtime
|
||||
var theme = chart.theme;
|
||||
var xAxisIndex = xAxis.index;
|
||||
xAxis.painter = chart.painter;
|
||||
xAxis.refreshComponent = delegate ()
|
||||
xAxis.refreshComponent = delegate()
|
||||
{
|
||||
var grid = chart.GetChartComponent<GridCoord>(xAxis.gridIndex);
|
||||
if (grid != null)
|
||||
{
|
||||
var yAxis = chart.GetChartComponent<YAxis>(xAxis.index);
|
||||
InitAxis(xAxis, yAxis, chart, this,
|
||||
InitAxis(yAxis,
|
||||
orient,
|
||||
grid.context.x,
|
||||
grid.context.y,
|
||||
@@ -94,7 +93,7 @@ namespace XCharts.Runtime
|
||||
var relativedAxis = chart.GetChartComponent<YAxis>(xAxis.gridIndex);
|
||||
var dataZoom = chart.GetDataZoomOfAxis(xAxis);
|
||||
|
||||
DrawAxisSplit(vh, xAxis, chart.theme.axis, dataZoom,
|
||||
DrawAxisSplit(vh, chart.theme.axis, dataZoom,
|
||||
Orient.Horizonal,
|
||||
grid.context.x,
|
||||
grid.context.y,
|
||||
@@ -114,16 +113,10 @@ namespace XCharts.Runtime
|
||||
|
||||
var dataZoom = chart.GetDataZoomOfAxis(xAxis);
|
||||
|
||||
var startY = grid.context.y + xAxis.offset;
|
||||
if (xAxis.IsTop())
|
||||
startY += grid.context.height;
|
||||
else
|
||||
startY += ComponentHelper.GetXAxisOnZeroOffset(chart.components, xAxis);
|
||||
|
||||
DrawAxisTick(vh, xAxis, chart.theme.axis, dataZoom,
|
||||
Orient.Horizonal,
|
||||
grid.context.x,
|
||||
startY,
|
||||
GetAxisLineXOrY(),
|
||||
grid.context.width);
|
||||
}
|
||||
}
|
||||
@@ -136,18 +129,24 @@ namespace XCharts.Runtime
|
||||
if (grid == null)
|
||||
return;
|
||||
|
||||
var startY = grid.context.y + xAxis.offset;
|
||||
if (xAxis.IsTop())
|
||||
startY += grid.context.height;
|
||||
else
|
||||
startY += ComponentHelper.GetXAxisOnZeroOffset(chart.components, xAxis);
|
||||
|
||||
DrawAxisLine(vh, xAxis, chart.theme.axis,
|
||||
Orient.Horizonal,
|
||||
grid.context.x,
|
||||
startY,
|
||||
GetAxisLineXOrY(),
|
||||
grid.context.width);
|
||||
}
|
||||
}
|
||||
|
||||
protected override float GetAxisLineXOrY()
|
||||
{
|
||||
var xAxis = component;
|
||||
var grid = chart.GetChartComponent<GridCoord>(xAxis.gridIndex);
|
||||
var startY = grid.context.y + xAxis.offset;
|
||||
if (xAxis.IsTop())
|
||||
startY += grid.context.height;
|
||||
else
|
||||
startY += ComponentHelper.GetXAxisOnZeroOffset(chart.components, xAxis);
|
||||
return startY;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user