mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 01:40:06 +00:00
3.0 - scatter chart and candlestick chart
This commit is contained in:
@@ -465,30 +465,36 @@ namespace XCharts
|
||||
|
||||
public static Color32 GetAreaColor(Serie serie, ThemeStyle theme, int index, bool highlight)
|
||||
{
|
||||
Color32 color = ChartConst.clearColor32;
|
||||
var areaStyle = serie.areaStyle;
|
||||
if (areaStyle == null || !areaStyle.show)
|
||||
return ColorUtil.clearColor32;
|
||||
var color = !ChartHelper.IsClearColor(areaStyle.color)
|
||||
? areaStyle.color : theme.GetColor(index);
|
||||
return color;
|
||||
|
||||
if (highlight)
|
||||
{
|
||||
if (!ChartHelper.IsClearColor(areaStyle.highlightColor))
|
||||
color = areaStyle.highlightColor;
|
||||
else
|
||||
color = ChartHelper.GetHighlightColor(color);
|
||||
ChartHelper.SetColorOpacity(ref color, areaStyle.opacity);
|
||||
return color;
|
||||
}
|
||||
if (!ChartHelper.IsClearColor(areaStyle.color)) color = areaStyle.color;
|
||||
else if (!ChartHelper.IsClearColor(serie.itemStyle.color)) color = serie.itemStyle.color;
|
||||
else color = theme.GetColor(index);
|
||||
ChartHelper.SetColorOpacity(ref color, areaStyle.opacity);
|
||||
return color;
|
||||
}
|
||||
|
||||
public static Color32 GetAreaToColor(Serie serie, ThemeStyle theme, int index, bool highlight)
|
||||
{
|
||||
Color32 color = ChartConst.clearColor32;
|
||||
var areaStyle = serie.areaStyle;
|
||||
if (areaStyle == null || !areaStyle.show)
|
||||
return ColorUtil.clearColor32;
|
||||
return color;
|
||||
if (!ChartHelper.IsClearColor(areaStyle.toColor))
|
||||
{
|
||||
var color = areaStyle.toColor;
|
||||
color = areaStyle.toColor;
|
||||
if (highlight)
|
||||
{
|
||||
if (!ChartHelper.IsClearColor(areaStyle.highlightToColor)) color = areaStyle.highlightToColor;
|
||||
@@ -534,6 +540,13 @@ namespace XCharts
|
||||
else return serie.lineStyle.GetWidth(theme.serie.lineWidth) * 2;
|
||||
}
|
||||
|
||||
public static Color32 GetSymbolBorderColor(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight)
|
||||
{
|
||||
var itemStyle = GetItemStyle(serie, serieData, highlight);
|
||||
if (itemStyle != null && !ChartHelper.IsClearColor(itemStyle.borderColor)) return itemStyle.borderColor;
|
||||
else return serie.itemStyle.borderColor;
|
||||
}
|
||||
|
||||
public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, float defaultWidth)
|
||||
{
|
||||
var itemStyle = GetItemStyle(serie, serieData, highlight);
|
||||
|
||||
@@ -18,11 +18,12 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
public static void ResetLabel(ChartText labelObject, LabelStyle label, ThemeStyle theme)
|
||||
public static void ResetLabel(ChartText labelObject, LabelStyle label, ThemeStyle theme,
|
||||
Color textColor, float rotate)
|
||||
{
|
||||
if (labelObject == null) return;
|
||||
labelObject.SetColor(!ChartHelper.IsClearColor(label.textStyle.color) ? label.textStyle.color :
|
||||
theme.common.textColor);
|
||||
labelObject.SetColor(textColor);
|
||||
labelObject.SetLocalEulerAngles(new Vector3(0, 0, rotate));
|
||||
labelObject.SetFontSize(label.textStyle.GetFontSize(theme.common));
|
||||
labelObject.SetFontStyle(label.textStyle.fontStyle);
|
||||
}
|
||||
@@ -247,6 +248,9 @@ namespace XCharts
|
||||
|
||||
public static Vector3 GetRealLabelPosition(SerieData serieData, LabelStyle label, LabelLine labelLine)
|
||||
{
|
||||
if (label == null || labelLine == null)
|
||||
return serieData.context.labelPosition;
|
||||
|
||||
if (label.position == LabelStyle.Position.Outside && labelLine.lineType != LabelLine.LineType.HorizontalLine)
|
||||
{
|
||||
var currAngle = serieData.context.halfAngle;
|
||||
|
||||
Reference in New Issue
Block a user