增加LineArrow配置带箭头曲线

This commit is contained in:
monitor1394
2019-09-19 19:26:05 +08:00
parent d62b3db85c
commit 73ad4bb7cc
10 changed files with 7757 additions and 6843 deletions

View File

@@ -859,12 +859,8 @@ namespace XCharts
if (xAxis.axisLine.symbol)
{
var axisLine = xAxis.axisLine;
top.x += xAxis.axisLine.symbolOffset;
var middle = new Vector3(top.x - axisLine.symbolHeight + axisLine.symbolDent, lineY);
left = new Vector3(top.x - axisLine.symbolHeight, lineY - axisLine.symbolWidth / 2);
var right = new Vector3(top.x - axisLine.symbolHeight, lineY + axisLine.symbolWidth / 2);
ChartHelper.DrawTriangle(vh, middle, top, left, m_ThemeInfo.axisLineColor);
ChartHelper.DrawTriangle(vh, middle, top, right, m_ThemeInfo.axisLineColor);
ChartHelper.DrawArrow(vh, new Vector3(coordinateX, lineY), top, axisLine.symbolWidth, axisLine.symbolHeight,
axisLine.symbolOffset, axisLine.symbolDent, m_ThemeInfo.axisLineColor);
}
}
}
@@ -881,12 +877,8 @@ namespace XCharts
if (yAxis.axisLine.symbol)
{
var axisLine = yAxis.axisLine;
top.y += yAxis.axisLine.symbolOffset;
var middle = new Vector3(lineX, top.y - axisLine.symbolHeight + axisLine.symbolDent);
var left = new Vector3(lineX - axisLine.symbolWidth / 2, top.y - axisLine.symbolHeight);
var right = new Vector3(lineX + axisLine.symbolWidth / 2, top.y - axisLine.symbolHeight);
ChartHelper.DrawTriangle(vh, middle, top, left, m_ThemeInfo.axisLineColor);
ChartHelper.DrawTriangle(vh, middle, top, right, m_ThemeInfo.axisLineColor);
ChartHelper.DrawArrow(vh, new Vector3(lineX, coordinateX), top, axisLine.symbolWidth, axisLine.symbolHeight,
axisLine.symbolOffset, axisLine.symbolDent, m_ThemeInfo.axisLineColor);
}
}
}

View File

@@ -0,0 +1,60 @@
using System;
using UnityEngine;
namespace XCharts
{
/// <summary>
/// </summary>
[Serializable]
public class LineArrow
{
public enum Position
{
/// <summary>
/// 末端箭头
/// </summary>
End,
/// <summary>
/// 头端箭头
/// </summary>
Start
}
[SerializeField] private bool m_Show;
[SerializeField] Position m_Position;
[SerializeField] private float m_Width = 10;
[SerializeField] private float m_Height = 15;
[SerializeField] private float m_Offset = 0;
[SerializeField] private float m_Dent = 3;
/// <summary>
/// Whether to show the arrow.
/// 是否显示箭头。
/// </summary>
public bool show { get { return m_Show; } set { m_Show = value; } }
/// <summary>
/// The position of arrow.
/// 箭头位置。
/// </summary>
public Position position { get { return m_Position; } set { m_Position = value; } }
/// <summary>
/// The widht of arrow.
/// 箭头宽。
/// </summary>
public float width { get { return m_Width; } set { m_Width = value; } }
/// <summary>
/// The height of arrow.
/// 箭头高。
/// </summary>
public float height { get { return m_Height; } set { m_Height = value; } }
/// <summary>
/// The offset of arrow.
/// 箭头偏移。
/// </summary>
public float offset { get { return m_Offset; } set { m_Offset = value; } }
/// <summary>
/// The dent of arrow.
/// 箭头的凹度。
/// </summary>
public float dent { get { return m_Dent; } set { m_Dent = value; } }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a0814769fbf984e8ea9a8e694a023078
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: