mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-30 05:08:48 +00:00
优化Line的默认配置效果
This commit is contained in:
@@ -74,6 +74,7 @@ slug: /changelog
|
|||||||
|
|
||||||
日志详情:
|
日志详情:
|
||||||
|
|
||||||
|
* (2023.07.31) 优化`Line`的默认配置效果
|
||||||
* (2023.07.27) 增加`Serie`的`minRadius`可设置最小半径
|
* (2023.07.27) 增加`Serie`的`minRadius`可设置最小半径
|
||||||
* (2023.07.26) 增加`MLValue`多样式数值
|
* (2023.07.26) 增加`MLValue`多样式数值
|
||||||
* (2023.07.25) 增加`XLog`日志系统
|
* (2023.07.25) 增加`XLog`日志系统
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ namespace XCharts.Example
|
|||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
public class Example_TestSerie : MonoBehaviour
|
public class Example_TestSerie : MonoBehaviour
|
||||||
{
|
{
|
||||||
public int maxCache = 100;
|
|
||||||
BaseChart chart;
|
BaseChart chart;
|
||||||
int timestamp;
|
int timestamp;
|
||||||
|
|
||||||
@@ -23,6 +22,14 @@ namespace XCharts.Example
|
|||||||
chart.GetSerie(0).radius[1] = Random.Range(50, 80);
|
chart.GetSerie(0).radius[1] = Random.Range(50, 80);
|
||||||
chart.SetAllDirty();
|
chart.SetAllDirty();
|
||||||
}
|
}
|
||||||
|
else if (Input.GetKeyDown(KeyCode.W))
|
||||||
|
{
|
||||||
|
chart.GetSerie(0).lineStyle.width = Random.Range(1, 5);
|
||||||
|
}
|
||||||
|
else if (Input.GetKeyDown(KeyCode.S))
|
||||||
|
{
|
||||||
|
chart.GetSerie(0).symbol.size = Random.Range(1, 10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,6 +31,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
var serie = chart.AddSerie<Line>(serieName);
|
var serie = chart.AddSerie<Line>(serieName);
|
||||||
serie.symbol.show = true;
|
serie.symbol.show = true;
|
||||||
|
serie.animation.interaction.radius.value = 1.5f;
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
chart.AddData(serie.index, UnityEngine.Random.Range(10, 90));
|
chart.AddData(serie.index, UnityEngine.Random.Range(10, 90));
|
||||||
|
|||||||
@@ -1044,7 +1044,7 @@ namespace XCharts.Runtime
|
|||||||
public override void SetVerticesDirty()
|
public override void SetVerticesDirty()
|
||||||
{
|
{
|
||||||
base.SetVerticesDirty();
|
base.SetVerticesDirty();
|
||||||
handler.ForceUpdateSerieContext();
|
interactDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool AnySerieDataVerticesDirty()
|
private bool AnySerieDataVerticesDirty()
|
||||||
@@ -1082,6 +1082,7 @@ namespace XCharts.Runtime
|
|||||||
public bool labelDirty { get; set; }
|
public bool labelDirty { get; set; }
|
||||||
public bool titleDirty { get; set; }
|
public bool titleDirty { get; set; }
|
||||||
public bool dataDirty { get; set; }
|
public bool dataDirty { get; set; }
|
||||||
|
public bool interactDirty { get; set; }
|
||||||
|
|
||||||
private void SetSerieNameDirty()
|
private void SetSerieNameDirty()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -132,6 +132,11 @@ namespace XCharts.Runtime
|
|||||||
serie.ResetInteract();
|
serie.ResetInteract();
|
||||||
serie.ClearVerticesDirty();
|
serie.ClearVerticesDirty();
|
||||||
}
|
}
|
||||||
|
if (serie.interactDirty)
|
||||||
|
{
|
||||||
|
serie.interactDirty = false;
|
||||||
|
m_ForceUpdateSerieContext = true;
|
||||||
|
}
|
||||||
UpdateSerieContextInternal();
|
UpdateSerieContextInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ namespace XCharts.Runtime
|
|||||||
if (stateStyle == null)
|
if (stateStyle == null)
|
||||||
{
|
{
|
||||||
var itemStyle = GetItemStyle(serie, serieData, SerieState.Normal);
|
var itemStyle = GetItemStyle(serie, serieData, SerieState.Normal);
|
||||||
border = itemStyle.borderWidth != 0 ? itemStyle.borderWidth : serie.lineStyle.GetWidth(theme.serie.lineWidth);
|
border = itemStyle.borderWidth != 0 ? itemStyle.borderWidth : serie.lineStyle.GetWidth(theme.serie.lineWidth) * 1.8f;
|
||||||
cornerRadius = itemStyle.cornerRadius;
|
cornerRadius = itemStyle.cornerRadius;
|
||||||
GetColor(ref borderColor, itemStyle.borderColor, itemStyle.borderColor, 1, theme, -1);
|
GetColor(ref borderColor, itemStyle.borderColor, itemStyle.borderColor, 1, theme, -1);
|
||||||
switch (state)
|
switch (state)
|
||||||
@@ -667,7 +667,7 @@ namespace XCharts.Runtime
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var itemStyle = stateStyle.itemStyle;
|
var itemStyle = stateStyle.itemStyle;
|
||||||
border = itemStyle.borderWidth != 0 ? itemStyle.borderWidth : stateStyle.lineStyle.GetWidth(theme.serie.lineWidth);
|
border = itemStyle.borderWidth != 0 ? itemStyle.borderWidth : stateStyle.lineStyle.GetWidth(theme.serie.lineWidth) * 1.8f;
|
||||||
cornerRadius = itemStyle.cornerRadius;
|
cornerRadius = itemStyle.cornerRadius;
|
||||||
GetColor(ref borderColor, stateStyle.itemStyle.borderColor, ColorUtil.clearColor32, 1, theme, -1);
|
GetColor(ref borderColor, stateStyle.itemStyle.borderColor, ColorUtil.clearColor32, 1, theme, -1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user