增加TooltipAuto自动设置显示类型和触发类型

This commit is contained in:
monitor1394
2023-09-01 08:01:27 +08:00
parent 9deb120446
commit a6ba17ee00
33 changed files with 154 additions and 108 deletions

View File

@@ -5,6 +5,7 @@ namespace XCharts.Runtime
[SerieConvert(typeof(Line), typeof(Pie))]
[CoordOptions(typeof(GridCoord), typeof(PolarCoord))]
[DefaultAnimation(AnimationType.BottomToTop)]
[DefaultTooltip(Tooltip.Type.Shadow, Tooltip.Trigger.Axis)]
[SerieComponent(typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField("m_Ignore")]

View File

@@ -8,6 +8,7 @@ namespace XCharts.Runtime
[SerieConvert(typeof(SimplifiedLine), typeof(Bar))]
[CoordOptions(typeof(GridCoord))]
[DefaultAnimation(AnimationType.LeftToRight, false)]
[DefaultTooltip(Tooltip.Type.Shadow, Tooltip.Trigger.Axis)]
[SerieComponent()]
[SerieDataComponent()]
[SerieDataExtraField()]

View File

@@ -5,6 +5,7 @@ namespace XCharts.Runtime
[System.Serializable]
[SerieHandler(typeof(CandlestickHandler), true)]
[DefaultAnimation(AnimationType.LeftToRight, false)]
[DefaultTooltip(Tooltip.Type.Shadow, Tooltip.Trigger.Axis)]
[SerieComponent()]
[SerieDataComponent(typeof(ItemStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField()]

View File

@@ -5,6 +5,7 @@ namespace XCharts.Runtime
[System.Serializable]
[SerieHandler(typeof(SimplifiedCandlestickHandler), true)]
[DefaultAnimation(AnimationType.LeftToRight, false)]
[DefaultTooltip(Tooltip.Type.Shadow, Tooltip.Trigger.Axis)]
[SerieComponent()]
[SerieDataComponent()]
[SerieDataExtraField()]

View File

@@ -23,6 +23,7 @@ namespace XCharts.Runtime
[System.Serializable]
[SerieHandler(typeof(HeatmapHandler), true)]
[DefaultAnimation(AnimationType.LeftToRight, false)]
[DefaultTooltip(Tooltip.Type.None, Tooltip.Trigger.Axis)]
[RequireChartComponent(typeof(VisualMap))]
[CoordOptions(typeof(GridCoord), typeof(PolarCoord))]
[SerieComponent(typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]

View File

@@ -7,22 +7,10 @@ namespace XCharts.Runtime
[SerieConvert(typeof(Bar), typeof(Pie))]
[CoordOptions(typeof(GridCoord), typeof(PolarCoord))]
[DefaultAnimation(AnimationType.LeftToRight, false)]
[SerieComponent(
typeof(LabelStyle),
typeof(EndLabelStyle),
typeof(LineArrow),
typeof(AreaStyle),
typeof(EmphasisStyle),
typeof(BlurStyle),
typeof(SelectStyle))]
[SerieDataComponent(
typeof(ItemStyle),
typeof(LabelStyle),
typeof(SerieSymbol),
typeof(EmphasisStyle),
typeof(BlurStyle),
typeof(SelectStyle))]
[DefaultTooltip(Tooltip.Type.Line, Tooltip.Trigger.Axis)]
[SerieDataExtraField("m_State", "m_Ignore")]
[SerieComponent(typeof(LabelStyle), typeof(EndLabelStyle), typeof(LineArrow), typeof(AreaStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(SerieSymbol), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
public class Line : Serie, INeedSerieContainer
{
public int containerIndex { get; internal set; }

View File

@@ -8,6 +8,7 @@ namespace XCharts.Runtime
[SerieConvert(typeof(SimplifiedBar), typeof(Line))]
[CoordOptions(typeof(GridCoord))]
[DefaultAnimation(AnimationType.LeftToRight, false)]
[DefaultTooltip(Tooltip.Type.Line, Tooltip.Trigger.Axis)]
[SerieComponent(typeof(AreaStyle))]
[SerieDataComponent()]
[SerieDataExtraField()]

View File

@@ -30,7 +30,7 @@ namespace XCharts.Runtime
public static Serie AddDefaultSerie(BaseChart chart, string serieName)
{
chart.AddChartComponentWhenNoExist<RadarCoord>();
chart.EnsureChartComponent<RadarCoord>();
var serie = chart.AddSerie<Radar>(serieName);
serie.symbol.show = true;
serie.symbol.type = SymbolType.Circle;

View File

@@ -5,6 +5,7 @@ namespace XCharts.Runtime
[System.Serializable]
[SerieHandler(typeof(EffectScatterHandler), true)]
[CoordOptions(typeof(GridCoord), typeof(SingleAxisCoord))]
[DefaultTooltip(Tooltip.Type.None, Tooltip.Trigger.Item)]
[SerieComponent(typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField("m_Radius")]

View File

@@ -5,6 +5,7 @@ namespace XCharts.Runtime
[System.Serializable]
[SerieHandler(typeof(ScatterHandler), true)]
[CoordOptions(typeof(GridCoord), typeof(SingleAxisCoord))]
[DefaultTooltip(Tooltip.Type.None, Tooltip.Trigger.Item)]
[SerieComponent(typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField("m_Radius")]

View File

@@ -115,5 +115,8 @@ namespace XCharts.Runtime
public List<PointInfo> drawPoints = new List<PointInfo>();
public SerieParams param = new SerieParams();
public ChartLabel titleObject { get; set; }
public Tooltip.Type tooltipType;
public Tooltip.Trigger tooltipTrigger;
}
}