海拔图和小地图
This commit is contained in:
1 parent
42fa59d103
commit
8ad36c965d
521 files changed
+1985033
-439
No files matched your search
@@ -0,0 +1,52 @@
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using XUGL;
|
||||
using System.Linq;
|
||||
|
||||
namespace XCharts.Examples
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
[ExecuteInEditMode]
|
||||
public class Example12_CustomDrawing : MonoBehaviour
|
||||
{
|
||||
LineChart chart;
|
||||
void Awake()
|
||||
{
|
||||
chart = gameObject.GetComponent<LineChart>();
|
||||
if (chart == null) return;
|
||||
|
||||
chart.onCustomDraw = delegate (VertexHelper vh)
|
||||
{
|
||||
var dataPoints = chart.series.list[0].dataPoints;
|
||||
if (dataPoints.Count > 0)
|
||||
{
|
||||
var pos = dataPoints[115];
|
||||
var zeroPos = new Vector3(chart.grid.runtimeX, chart.grid.runtimeY);
|
||||
var startPos = new Vector3(pos.x, zeroPos.y);
|
||||
var endPos = new Vector3(pos.x, zeroPos.y + chart.grid.runtimeHeight);
|
||||
//UGL.DrawLine(vh, startPos, endPos, chart.theme.serie.lineWidth, Color.blue);
|
||||
foreach (var item in dataPoints)
|
||||
{
|
||||
UGL.DrawDiamond(vh, item, 5, Color.blue);
|
||||
if (item == dataPoints.LastOrDefault())
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
vh.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user