mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 01:40:06 +00:00
XCharts 2.0
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/******************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/******************************************/
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
@@ -17,8 +17,6 @@ namespace XCharts
|
||||
[DisallowMultipleComponent]
|
||||
public partial class BarChart : CoordinateChart
|
||||
{
|
||||
protected Action<PointerEventData, int> m_OnPointerClickBar;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
@@ -28,14 +26,13 @@ namespace XCharts
|
||||
protected override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
m_Title.text = "BarChart";
|
||||
m_Tooltip.type = Tooltip.Type.Shadow;
|
||||
title.text = "BarChart";
|
||||
tooltip.type = Tooltip.Type.Shadow;
|
||||
RemoveData();
|
||||
AddSerie(SerieType.Bar, "serie1");
|
||||
SerieTemplate.AddDefaultBarSerie(this, "serie1");
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
AddXAxisData("x" + (i + 1));
|
||||
AddData(0, UnityEngine.Random.Range(10, 90));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -46,7 +43,7 @@ namespace XCharts
|
||||
if (m_OnPointerClickBar == null) return;
|
||||
if (pointerPos == Vector2.zero) return;
|
||||
UpdateTooltipValue(pointerPos);
|
||||
var dataIndex = m_Tooltip.runtimeDataIndex[0];
|
||||
var dataIndex = tooltip.runtimeDataIndex[0];
|
||||
if (dataIndex >= 0)
|
||||
{
|
||||
m_OnPointerClickBar(eventData, dataIndex);
|
||||
|
||||
Reference in New Issue
Block a user