AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
MarkLine.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using System.Collections.Generic;
9 using UnityEngine;
10 using UnityEngine.EventSystems;
11 using UnityEngine.UI;
12 
13 namespace XCharts
14 {
18  public enum MarkLineType
19  {
20  None,
24  Min,
28  Max,
32  Average,
36  Median
37  }
42  [System.Serializable]
43  public class MarkLineData : SubComponent
44  {
45  [SerializeField] private string m_Name;
46  [SerializeField] private MarkLineType m_Type = MarkLineType.None;
47  [SerializeField] private int m_Dimension = 1;
48  [SerializeField] private float m_XPosition;
49  [SerializeField] private float m_YPosition;
50  [SerializeField] private double m_XValue;
51  [SerializeField] private double m_YValue;
52  [SerializeField] private int m_Group = 0;
53  [SerializeField] private bool m_ZeroPosition = false;
54 
55  [SerializeField] private SerieSymbol m_StartSymbol = new SerieSymbol();
56  [SerializeField] private SerieSymbol m_EndSymbol = new SerieSymbol();
57  [SerializeField] private LineStyle m_LineStyle = new LineStyle();
58  [SerializeField] private SerieLabel m_Label = new SerieLabel();
59  //[SerializeField] private Emphasis m_Emphasis = new Emphasis();
60 
61  public int index { get; set; }
62  public Vector3 runtimeStartPosition { get; internal set; }
63  public Vector3 runtimeEndPosition { get; internal set; }
64  public Vector3 runtimeCurrentEndPosition { get; internal set; }
65  public ChartLabel runtimeLabel { get; internal set; }
66  public double runtimeValue { get; internal set; }
67 
72  public string name
73  {
74  get { return m_Name; }
75  set { if (PropertyUtil.SetClass(ref m_Name, value)) SetVerticesDirty(); }
76  }
81  public MarkLineType type
82  {
83  get { return m_Type; }
84  set { if (PropertyUtil.SetStruct(ref m_Type, value)) SetVerticesDirty(); }
85  }
90  public int dimension
91  {
92  get { return m_Dimension; }
93  set { if (PropertyUtil.SetStruct(ref m_Dimension, value)) SetVerticesDirty(); }
94  }
99  public float xPosition
100  {
101  get { return m_XPosition; }
102  set { if (PropertyUtil.SetStruct(ref m_XPosition, value)) SetVerticesDirty(); }
103  }
108  public float yPosition
109  {
110  get { return m_YPosition; }
111  set { if (PropertyUtil.SetStruct(ref m_YPosition, value)) SetVerticesDirty(); }
112  }
117  public double xValue
118  {
119  get { return m_XValue; }
120  set { if (PropertyUtil.SetStruct(ref m_XValue, value)) SetVerticesDirty(); }
121  }
126  public double yValue
127  {
128  get { return m_YValue; }
129  set { if (PropertyUtil.SetStruct(ref m_YValue, value)) SetVerticesDirty(); }
130  }
135  public int group
136  {
137  get { return m_Group; }
138  set { if (PropertyUtil.SetStruct(ref m_Group, value)) SetVerticesDirty(); }
139  }
144  public bool zeroPosition
145  {
146  get { return m_ZeroPosition; }
147  set { if (PropertyUtil.SetStruct(ref m_ZeroPosition, value)) SetVerticesDirty(); }
148  }
153  public SerieSymbol startSymbol
154  {
155  get { return m_StartSymbol; }
156  set { if (PropertyUtil.SetClass(ref m_StartSymbol, value)) SetVerticesDirty(); }
157  }
162  public SerieSymbol endSymbol
163  {
164  get { return m_EndSymbol; }
165  set { if (PropertyUtil.SetClass(ref m_EndSymbol, value)) SetVerticesDirty(); }
166  }
171  public LineStyle lineStyle
172  {
173  get { return m_LineStyle; }
174  set { if (PropertyUtil.SetClass(ref m_LineStyle, value)) SetVerticesDirty(); }
175  }
180  public SerieLabel label
181  {
182  get { return m_Label; }
183  set { if (PropertyUtil.SetClass(ref m_Label, value)) SetVerticesDirty(); }
184  }
185  // public Emphasis emphasis
186  // {
187  // get { return m_Emphasis; }
188  // set { if (PropertyUtil.SetClass(ref m_Emphasis, value)) SetVerticesDirty(); }
189  // }
190  }
191 
196  [System.Serializable]
197  public class MarkLine : SubComponent
198  {
199  [SerializeField] private bool m_Show;
200  [SerializeField] private SerieAnimation m_Animation = new SerieAnimation();
201  [SerializeField] private List<MarkLineData> m_Data = new List<MarkLineData>();
202 
207  public bool show
208  {
209  get { return m_Show; }
210  set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
211  }
217  {
218  get { return m_Animation; }
219  set { if (PropertyUtil.SetClass(ref m_Animation, value)) SetVerticesDirty(); }
220  }
229  public List<MarkLineData> data
230  {
231  get { return m_Data; }
232  set { if (PropertyUtil.SetClass(ref m_Data, value)) SetVerticesDirty(); }
233  }
234  public static MarkLine defaultMarkLine
235  {
236  get
237  {
238  var markLine = new MarkLine
239  {
240  m_Show = false,
241  m_Data = new List<MarkLineData>()
242  };
243  var data = new MarkLineData();
244  data.name = "average";
245  data.type = MarkLineType.Average;
246  data.lineStyle.type = LineStyle.Type.Dashed;
247  data.lineStyle.color = Color.blue;
248  data.startSymbol.show = true;
249  data.startSymbol.type = SerieSymbolType.Circle;
250  data.endSymbol.show = true;
251  data.endSymbol.type = SerieSymbolType.Arrow;
252  data.label.show = true;
253  data.label.numericFormatter = "f1";
254  data.label.formatter = "{c}";
255  markLine.data.Add(data);
256  return markLine;
257  }
258  }
259  }
260 
261  internal class MarkLineHandler : IComponentHandler
262  {
263  public CoordinateChart chart;
264  private GameObject m_MarkLineLabelRoot;
265 
266  public MarkLineHandler(CoordinateChart chart)
267  {
268  this.chart = chart;
269  }
270 
271  public void DrawBase(VertexHelper vh)
272  {
273  }
274 
275  public void DrawTop(VertexHelper vh)
276  {
277  DrawMarkLine(vh);
278  }
279 
280  public void Init()
281  {
282  m_MarkLineLabelRoot = ChartHelper.AddObject("markline", chart.transform, chart.chartMinAnchor,
283  chart.chartMaxAnchor, chart.chartPivot, chart.chartSizeDelta);
284  m_MarkLineLabelRoot.hideFlags = chart.chartHideFlags;
285  ChartHelper.HideAllObject(m_MarkLineLabelRoot);
286  foreach (var serie in chart.series.list) InitMarkLine(serie);
287  }
288 
289  public void OnBeginDrag(PointerEventData eventData)
290  {
291  }
292 
293  public void OnDrag(PointerEventData eventData)
294  {
295  }
296 
297  public void OnEndDrag(PointerEventData eventData)
298  {
299  }
300 
301  public void OnPointerDown(PointerEventData eventData)
302  {
303  }
304 
305  public void OnScroll(PointerEventData eventData)
306  {
307  }
308 
309  public void Update()
310  {
311  foreach (var serie in chart.series.list)
312  {
313  var show = serie.show && serie.markLine.show;
314  foreach (var data in serie.markLine.data)
315  {
316  if (data.runtimeLabel != null)
317  {
318  if (data.runtimeLabel.gameObject.activeSelf != show)
319  data.runtimeLabel.gameObject.SetActive(show);
320  if (show)
321  {
322  data.runtimeLabel.SetPosition(MarkLineHelper.GetLabelPosition(data));
323  data.runtimeLabel.SetText(MarkLineHelper.GetFormatterContent(serie, data));
324  }
325  }
326  }
327  }
328  }
329 
330  private void InitMarkLine(Serie serie)
331  {
332  if (!serie.show || !serie.markLine.show) return;
333  ResetTempMarkLineGroupData(serie.markLine);
334  var serieColor = (Color)chart.theme.GetColor(chart.GetLegendRealShowNameIndex(serie.name));
335  if (m_TempGroupData.Count > 0)
336  {
337  foreach (var kv in m_TempGroupData)
338  {
339  if (kv.Value.Count >= 2)
340  {
341  var data = kv.Value[0];
342  InitMarkLineLabel(serie, data, serieColor);
343  }
344  }
345  }
346  foreach (var data in serie.markLine.data)
347  {
348  if (data.group != 0) continue;
349  InitMarkLineLabel(serie, data, serieColor);
350  }
351  }
352 
353  private void InitMarkLineLabel(Serie serie, MarkLineData data, Color serieColor)
354  {
355  data.painter = chart.m_PainterTop;
356  data.refreshComponent = delegate ()
357  {
358  var label = data.label;
359  var textName = string.Format("markLine_{0}_{1}", serie.index, data.index);
360  var color = !ChartHelper.IsClearColor(label.textStyle.color) ? label.textStyle.color : chart.theme.axis.textColor;
361  var element = ChartHelper.AddSerieLabel(textName, m_MarkLineLabelRoot.transform, label.backgroundWidth,
362  label.backgroundHeight, color, label.textStyle, chart.theme);
363  var isAutoSize = label.backgroundWidth == 0 || label.backgroundHeight == 0;
364  var item = new ChartLabel();
365  item.SetLabel(element, isAutoSize, label.paddingLeftRight, label.paddingTopBottom);
366  item.SetIconActive(false);
367  item.SetActive(data.label.show);
368  item.SetPosition(MarkLineHelper.GetLabelPosition(data));
369  item.SetText(MarkLineHelper.GetFormatterContent(serie, data));
370  data.runtimeLabel = item;
371  };
372  data.refreshComponent();
373  }
374 
375  private void DrawMarkLine(VertexHelper vh)
376  {
377  foreach (var serie in chart.series.list)
378  {
379  DrawMarkLine(vh, serie);
380  }
381  }
382 
383  private Dictionary<int, List<MarkLineData>> m_TempGroupData = new Dictionary<int, List<MarkLineData>>();
384  private void DrawMarkLine(VertexHelper vh, Serie serie)
385  {
386  if (!serie.show || !serie.markLine.show) return;
387  if (serie.markLine.data.Count == 0) return;
388  var yAxis = chart.GetSerieYAxisOrDefault(serie);
389  var xAxis = chart.GetSerieXAxisOrDefault(serie);
390  var grid = chart.GetSerieGridOrDefault(serie);
391  var dataZoom = DataZoomHelper.GetAxisRelatedDataZoom(xAxis, chart.dataZooms);
392  var animation = serie.markLine.animation;
393  var showData = serie.GetDataList(dataZoom);
394  var sp = Vector3.zero;
395  var ep = Vector3.zero;
396  var colorIndex = chart.GetLegendRealShowNameIndex(serie.name);
397  var serieColor = SerieHelper.GetLineColor(serie, chart.theme, colorIndex, false);
398  animation.InitProgress(1, 0, 1f);
399  ResetTempMarkLineGroupData(serie.markLine);
400  if (m_TempGroupData.Count > 0)
401  {
402  foreach (var kv in m_TempGroupData)
403  {
404  if (kv.Value.Count >= 2)
405  {
406  sp = GetSinglePos(xAxis, yAxis, grid, serie, dataZoom, kv.Value[0], showData.Count);
407  ep = GetSinglePos(xAxis, yAxis, grid, serie, dataZoom, kv.Value[1], showData.Count);
408  kv.Value[0].runtimeStartPosition = sp;
409  kv.Value[1].runtimeEndPosition = ep;
410  DrawMakLineData(vh, kv.Value[0], animation, serie, grid, serieColor, sp, ep);
411  }
412  }
413  }
414  foreach (var data in serie.markLine.data)
415  {
416  if (data.group != 0) continue;
417  switch (data.type)
418  {
419  case MarkLineType.Min:
420  data.runtimeValue = SerieHelper.GetMinData(serie, data.dimension, dataZoom);
421  GetStartEndPos(xAxis, yAxis, grid, data.runtimeValue, ref sp, ref ep);
422  break;
423  case MarkLineType.Max:
424  data.runtimeValue = SerieHelper.GetMaxData(serie, data.dimension, dataZoom);
425  GetStartEndPos(xAxis, yAxis, grid, data.runtimeValue, ref sp, ref ep);
426  break;
427  case MarkLineType.Average:
428  data.runtimeValue = SerieHelper.GetAverageData(serie, data.dimension, dataZoom);
429  GetStartEndPos(xAxis, yAxis, grid, data.runtimeValue, ref sp, ref ep);
430  break;
431  case MarkLineType.Median:
432  data.runtimeValue = SerieHelper.GetMedianData(serie, data.dimension, dataZoom);
433  GetStartEndPos(xAxis, yAxis, grid, data.runtimeValue, ref sp, ref ep);
434  break;
435  case MarkLineType.None:
436  if (data.xPosition != 0)
437  {
438  data.runtimeValue = data.xPosition;
439  var pX = grid.runtimeX + data.xPosition;
440  sp = new Vector3(pX, grid.runtimeY);
441  ep = new Vector3(pX, grid.runtimeY + grid.runtimeHeight);
442  }
443  else if (data.yPosition != 0)
444  {
445  data.runtimeValue = data.yPosition;
446  var pY = grid.runtimeY + data.yPosition;
447  sp = new Vector3(grid.runtimeX, pY);
448  ep = new Vector3(grid.runtimeX + grid.runtimeWidth, pY);
449  }
450  else if (data.yValue != 0)
451  {
452  data.runtimeValue = data.yValue;
453  if (yAxis.IsCategory())
454  {
455  var pY = AxisHelper.GetAxisPosition(grid, yAxis, data.yValue, showData.Count, dataZoom);
456  sp = new Vector3(grid.runtimeX, pY);
457  ep = new Vector3(grid.runtimeX + grid.runtimeWidth, pY);
458  }
459  else
460  {
461  GetStartEndPos(xAxis, yAxis, grid, data.yValue, ref sp, ref ep);
462  }
463  }
464  else
465  {
466  data.runtimeValue = data.xValue;
467  if (xAxis.IsCategory())
468  {
469  var pX = AxisHelper.GetAxisPosition(grid, xAxis, data.xValue, showData.Count, dataZoom);
470  sp = new Vector3(pX, grid.runtimeY);
471  ep = new Vector3(pX, grid.runtimeY + grid.runtimeHeight);
472  }
473  else
474  {
475  GetStartEndPos(xAxis, yAxis, grid, data.xValue, ref sp, ref ep);
476  }
477  }
478  break;
479  default:
480  break;
481  }
482  data.runtimeStartPosition = sp;
483  data.runtimeEndPosition = ep;
484  DrawMakLineData(vh, data, animation, serie, grid, serieColor, sp, ep);
485  }
486  if (!animation.IsFinish())
487  {
488  animation.CheckProgress(1f);
489  chart.RefreshTopPainter();
490  }
491  }
492 
493  private void ResetTempMarkLineGroupData(MarkLine markLine)
494  {
495  m_TempGroupData.Clear();
496  for (int i = 0; i < markLine.data.Count; i++)
497  {
498  var data = markLine.data[i];
499  data.index = i;
500  if (data.group == 0) continue;
501  if (!m_TempGroupData.ContainsKey(data.group))
502  {
503  m_TempGroupData[data.group] = new List<MarkLineData>();
504  }
505  m_TempGroupData[data.group].Add(data);
506  }
507  }
508 
509  private void DrawMakLineData(VertexHelper vh, MarkLineData data, SerieAnimation animation, Serie serie,
510  Grid grid, Color32 serieColor, Vector3 sp, Vector3 ep)
511  {
512  if (!animation.IsFinish())
513  ep = Vector3.Lerp(sp, ep, animation.GetCurrDetail());
514  data.runtimeCurrentEndPosition = ep;
515  if (sp != Vector3.zero || ep != Vector3.zero)
516  {
517  chart.ClampInChart(ref sp);
518  chart.ClampInChart(ref ep);
519  var theme = chart.theme.axis;
520  var lineColor = ChartHelper.IsClearColor(data.lineStyle.color) ? serieColor : data.lineStyle.color;
521  var lineWidth = data.lineStyle.width == 0 ? theme.lineWidth : data.lineStyle.width;
522  ChartDrawer.DrawLineStyle(vh, data.lineStyle, sp, ep, lineWidth, LineStyle.Type.Dashed, lineColor, lineColor);
523  if (data.startSymbol != null && data.startSymbol.show)
524  {
525  DrawMarkLineSymbol(vh, data.startSymbol, serie, grid, chart.theme, sp, sp, lineColor);
526  }
527  if (data.endSymbol != null && data.endSymbol.show)
528  {
529  DrawMarkLineSymbol(vh, data.endSymbol, serie, grid, chart.theme, ep, sp, lineColor);
530  }
531  }
532  }
533 
534  private void DrawMarkLineSymbol(VertexHelper vh, SerieSymbol symbol, Serie serie, Grid grid, ChartTheme theme,
535  Vector3 pos, Vector3 startPos, Color32 lineColor)
536  {
537  var symbolSize = symbol.GetSize(null, theme.serie.lineSymbolSize);
538  var tickness = SerieHelper.GetSymbolBorder(serie, null, theme, false);
539  var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, null, false);
540  chart.Internal_CheckClipAndDrawSymbol(vh, symbol.type, symbolSize, tickness, pos, lineColor, lineColor,
541  ColorUtil.clearColor32, symbol.gap, true, cornerRadius, grid, startPos);
542  }
543 
544  private void GetStartEndPos(Axis xAxis, Axis yAxis, Grid grid, double value, ref Vector3 sp, ref Vector3 ep)
545  {
546  if (xAxis.IsCategory())
547  {
548  var pY = AxisHelper.GetAxisPosition(grid, yAxis, value);
549  sp = new Vector3(grid.runtimeX, pY);
550  ep = new Vector3(grid.runtimeX + grid.runtimeWidth, pY);
551  }
552  else
553  {
554  var pX = AxisHelper.GetAxisPosition(grid, xAxis, value);
555  sp = new Vector3(pX, grid.runtimeY);
556  ep = new Vector3(pX, grid.runtimeY + grid.runtimeHeight);
557  }
558  }
559 
560  private float GetAxisPosition(Grid grid, Axis axis, DataZoom dataZoom, int dataCount, double value)
561  {
562  return AxisHelper.GetAxisPosition(grid, axis, value, dataCount, dataZoom);
563  }
564 
565  private Vector3 GetSinglePos(Axis xAxis, Axis yAxis, Grid grid, Serie serie, DataZoom dataZoom, MarkLineData data,
566  int serieDataCount)
567  {
568  switch (data.type)
569  {
570  case MarkLineType.Min:
571  var serieData = SerieHelper.GetMinSerieData(serie, data.dimension, dataZoom);
572  data.runtimeValue = serieData.GetData(data.dimension);
573  var pX = GetAxisPosition(grid, xAxis, dataZoom, serieDataCount, serieData.index);
574  var pY = GetAxisPosition(grid, yAxis, dataZoom, serieDataCount, data.runtimeValue);
575  return new Vector3(pX, pY);
576  case MarkLineType.Max:
577  serieData = SerieHelper.GetMaxSerieData(serie, data.dimension, dataZoom);
578  data.runtimeValue = serieData.GetData(data.dimension);
579  pX = GetAxisPosition(grid, xAxis, dataZoom, serieDataCount, serieData.index);
580  pY = GetAxisPosition(grid, yAxis, dataZoom, serieDataCount, data.runtimeValue);
581  return new Vector3(pX, pY);
582  case MarkLineType.None:
583  if (data.zeroPosition)
584  {
585  data.runtimeValue = 0;
586  return grid.runtimePosition;
587  }
588  else
589  {
590  pX = data.xPosition != 0 ? grid.runtimeX + data.xPosition :
591  GetAxisPosition(grid, xAxis, dataZoom, serieDataCount, data.xValue);
592  pY = data.yPosition != 0 ? grid.runtimeY + data.yPosition :
593  GetAxisPosition(grid, yAxis, dataZoom, serieDataCount, data.yValue);
594  data.runtimeValue = data.yValue;
595  return new Vector3(pX, pY);
596  }
597  default:
598  return grid.runtimePosition;
599  }
600  }
601  }
602 
603  internal static class MarkLineHelper
604  {
605  public static string GetFormatterContent(Serie serie, MarkLineData data)
606  {
607  var serieLabel = data.label;
608  var numericFormatter = serieLabel.numericFormatter;
609  if (serieLabel.formatterFunction != null)
610  {
611  return serieLabel.formatterFunction(data.index, data.runtimeValue);
612  }
613  if (string.IsNullOrEmpty(serieLabel.formatter))
614  return ChartCached.NumberToStr(data.runtimeValue, numericFormatter);
615  else
616  {
617  var content = serieLabel.formatter;
618  FormatterHelper.ReplaceSerieLabelContent(ref content, numericFormatter, data.runtimeValue,
619  0, serie.name, data.name, Color.clear);
620  return content;
621  }
622  }
623 
624  public static Vector3 GetLabelPosition(MarkLineData data)
625  {
626  if (!data.label.show) return Vector3.zero;
627  var dir = (data.runtimeEndPosition - data.runtimeStartPosition).normalized;
628  var horizontal = Mathf.Abs(Vector3.Dot(dir, Vector3.right)) == 1;
629  var labelWidth = data.runtimeLabel == null ? 50 : data.runtimeLabel.GetLabelWidth();
630  var labelHeight = data.runtimeLabel == null ? 20 : data.runtimeLabel.GetLabelHeight();
631  switch (data.label.position)
632  {
633  case SerieLabel.Position.Start:
634  if (horizontal) return data.runtimeStartPosition + data.label.offset + labelWidth / 2 * Vector3.left;
635  else return data.runtimeStartPosition + data.label.offset + labelHeight / 2 * Vector3.down;
636  case SerieLabel.Position.Middle:
637  var center = (data.runtimeStartPosition + data.runtimeCurrentEndPosition) / 2;
638  if (horizontal) return center + data.label.offset + labelHeight / 2 * Vector3.up;
639  else return center + data.label.offset + labelWidth / 2 * Vector3.right;
640  default:
641  if (horizontal) return data.runtimeCurrentEndPosition + data.label.offset + labelWidth / 2 * Vector3.right;
642  else return data.runtimeCurrentEndPosition + data.label.offset + labelHeight / 2 * Vector3.up;
643  }
644  }
645  }
646 }
XCharts.ChartLabel
Definition: ChartLabel.cs:13
XCharts.MarkLineData.xPosition
float xPosition
The x coordinate relative to the origin, in pixels. 相对原点的 x 坐标,单位像素。当type为None时有效。
Definition: MarkLine.cs:100
XCharts.MarkLineData.label
SerieLabel label
Text styles of label. You can set position to Start, Middle, and End to display text in different loc...
Definition: MarkLine.cs:181
XCharts.MarkLine.show
bool show
Whether to display the marking line. 是否显示标线。
Definition: MarkLine.cs:208
XCharts.SampleType.Min
@ Min
Take the minimum value of the filter point. 取过滤点的最小值。
XCharts.MarkLineData
Data of marking line. 图表标线的数据。
Definition: MarkLine.cs:43
XCharts.MarkLineData.type
MarkLineType type
Special label types, are used to label maximum value, minimum value and so on. 特殊的标线类型,用于标注最大值最小值等。
Definition: MarkLine.cs:82
XCharts.RoseType.None
@ None
Don't show as Nightingale chart.不展示成南丁格尔玫瑰图
XCharts.SubComponent
Definition: ChartComponent.cs:71
XCharts.MarkLineData.yPosition
float yPosition
The y coordinate relative to the origin, in pixels. 相对原点的 y 坐标,单位像素。当type为None时有效。
Definition: MarkLine.cs:109
XCharts.SampleType.Max
@ Max
Take the maximum value of the filter point. 取过滤点的最大值。
XCharts
Definition: RewardChart.cs:14
XCharts.MarkLineData.yValue
double yValue
That's the value on the Y-axis. The value specified when the Y axis is the category axis represents t...
Definition: MarkLine.cs:127
XCharts.MarkLineData.dimension
int dimension
From which dimension of data to calculate the maximum and minimum value and so on....
Definition: MarkLine.cs:91
XCharts.MarkLineData.group
int group
Grouping. When the group is not 0, it means that this data is the starting point or end point of the ...
Definition: MarkLine.cs:136
XCharts.LineStyle
The style of line. 线条样式。 注: 修改 lineStyle 中的颜色不会影响图例颜色,如果需要图例颜色和折线图颜色一致,需修改 itemStyle....
Definition: LineStyle.cs:20
XCharts.MarkLine
Use a line in the chart to illustrate. 图表标线。
Definition: MarkLine.cs:197
XCharts.SerieLabel
Text label of chart, to explain some data information about graphic item like value,...
Definition: SerieLabel.cs:18
XCharts.MarkLineData.lineStyle
LineStyle lineStyle
The line style of markline. 标线样式。
Definition: MarkLine.cs:172
XCharts.SerieSymbolType
SerieSymbolType
the type of symbol. 标记图形的类型。
Definition: SerieSymbol.cs:18
XCharts.MarkLine.animation
SerieAnimation animation
The animation of markline. 标线的动画样式。
Definition: MarkLine.cs:217
XCharts.MarkLineData.name
string name
Name of the marker, which will display as a label. 标线名称,将会作为文字显示。label的formatter可通过{b}显示名称,通过{c}显示数值。
Definition: MarkLine.cs:73
XCharts.SampleType.Average
@ Average
Take the average of the filter points. 取过滤点的平均值。
XCharts.MarkLine.data
List< MarkLineData > data
A list of marked data. When the group of data item is 0, each data item represents a line; When the g...
Definition: MarkLine.cs:230
XCharts.MarkLineType.Median
@ Median
中位数。
XCharts.MarkLineData.startSymbol
SerieSymbol startSymbol
The symbol of the start point of markline. 起始点的图形标记。
Definition: MarkLine.cs:154
XCharts.MarkLineData.zeroPosition
bool zeroPosition
Is the origin of the coordinate system. 是否为坐标系原点。
Definition: MarkLine.cs:145
XCharts.MarkLineType
MarkLineType
标线类型
Definition: MarkLine.cs:18
XCharts.MarkLineData.xValue
double xValue
The value specified on the X-axis. A value specified when the X-axis is the category axis represents ...
Definition: MarkLine.cs:118
XCharts.SerieAnimation
the animation of serie. 动画表现。
Definition: SerieAnimation.cs:22
XCharts.SerieSymbol
系列数据项的标记的图形
Definition: SerieSymbol.cs:91
XCharts.MarkLineData.endSymbol
SerieSymbol endSymbol
The symbol of the end point of markline. 结束点的图形标记。
Definition: MarkLine.cs:163