* UILineChart:更改ToolTip多个点时显示排序
This commit is contained in:
parent
c624475be3
commit
d371042135
Binary file not shown.
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
@ -81,7 +81,6 @@ namespace Sunny.UI.Demo.Charts
|
|||||||
foreach (var point in points)
|
foreach (var point in points)
|
||||||
{
|
{
|
||||||
sb.Append(point.Name + ", " + point.Index + ", " + point.X + ", " + point.Y);
|
sb.Append(point.Name + ", " + point.Index + ", " + point.X + ", " + point.Y);
|
||||||
sb.Append('\n');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine(sb.ToString());
|
Console.WriteLine(sb.ToString());
|
||||||
|
5
SunnyUI.Demo/Controls/FTextBox.Designer.cs
generated
5
SunnyUI.Demo/Controls/FTextBox.Designer.cs
generated
@ -87,6 +87,7 @@
|
|||||||
this.uiTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.uiTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.uiTextBox1.Maximum = 2147483647D;
|
this.uiTextBox1.Maximum = 2147483647D;
|
||||||
this.uiTextBox1.Minimum = -2147483648D;
|
this.uiTextBox1.Minimum = -2147483648D;
|
||||||
|
this.uiTextBox1.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
this.uiTextBox1.Name = "uiTextBox1";
|
this.uiTextBox1.Name = "uiTextBox1";
|
||||||
this.uiTextBox1.Padding = new System.Windows.Forms.Padding(5);
|
this.uiTextBox1.Padding = new System.Windows.Forms.Padding(5);
|
||||||
this.uiTextBox1.Size = new System.Drawing.Size(221, 29);
|
this.uiTextBox1.Size = new System.Drawing.Size(221, 29);
|
||||||
@ -128,6 +129,7 @@
|
|||||||
this.uiTextBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.uiTextBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.uiTextBox2.Maximum = 9D;
|
this.uiTextBox2.Maximum = 9D;
|
||||||
this.uiTextBox2.Minimum = 0D;
|
this.uiTextBox2.Minimum = 0D;
|
||||||
|
this.uiTextBox2.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
this.uiTextBox2.Name = "uiTextBox2";
|
this.uiTextBox2.Name = "uiTextBox2";
|
||||||
this.uiTextBox2.Padding = new System.Windows.Forms.Padding(5);
|
this.uiTextBox2.Padding = new System.Windows.Forms.Padding(5);
|
||||||
this.uiTextBox2.Size = new System.Drawing.Size(221, 29);
|
this.uiTextBox2.Size = new System.Drawing.Size(221, 29);
|
||||||
@ -157,6 +159,7 @@
|
|||||||
this.uiTextBox3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.uiTextBox3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.uiTextBox3.Maximum = 2147483647D;
|
this.uiTextBox3.Maximum = 2147483647D;
|
||||||
this.uiTextBox3.Minimum = -2147483648D;
|
this.uiTextBox3.Minimum = -2147483648D;
|
||||||
|
this.uiTextBox3.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
this.uiTextBox3.Name = "uiTextBox3";
|
this.uiTextBox3.Name = "uiTextBox3";
|
||||||
this.uiTextBox3.Padding = new System.Windows.Forms.Padding(5);
|
this.uiTextBox3.Padding = new System.Windows.Forms.Padding(5);
|
||||||
this.uiTextBox3.Size = new System.Drawing.Size(221, 29);
|
this.uiTextBox3.Size = new System.Drawing.Size(221, 29);
|
||||||
@ -216,6 +219,7 @@
|
|||||||
this.uiRichTextBox1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
this.uiRichTextBox1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||||
this.uiRichTextBox1.Location = new System.Drawing.Point(388, 219);
|
this.uiRichTextBox1.Location = new System.Drawing.Point(388, 219);
|
||||||
this.uiRichTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.uiRichTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
|
this.uiRichTextBox1.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
this.uiRichTextBox1.Name = "uiRichTextBox1";
|
this.uiRichTextBox1.Name = "uiRichTextBox1";
|
||||||
this.uiRichTextBox1.Padding = new System.Windows.Forms.Padding(2);
|
this.uiRichTextBox1.Padding = new System.Windows.Forms.Padding(2);
|
||||||
this.uiRichTextBox1.Size = new System.Drawing.Size(308, 226);
|
this.uiRichTextBox1.Size = new System.Drawing.Size(308, 226);
|
||||||
@ -255,6 +259,7 @@
|
|||||||
this.uiTextBox4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.uiTextBox4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.uiTextBox4.Maximum = 2147483647D;
|
this.uiTextBox4.Maximum = 2147483647D;
|
||||||
this.uiTextBox4.Minimum = -2147483648D;
|
this.uiTextBox4.Minimum = -2147483648D;
|
||||||
|
this.uiTextBox4.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
this.uiTextBox4.Multiline = true;
|
this.uiTextBox4.Multiline = true;
|
||||||
this.uiTextBox4.Name = "uiTextBox4";
|
this.uiTextBox4.Name = "uiTextBox4";
|
||||||
this.uiTextBox4.Padding = new System.Windows.Forms.Padding(5);
|
this.uiTextBox4.Padding = new System.Windows.Forms.Padding(5);
|
||||||
|
@ -483,31 +483,6 @@
|
|||||||
<None Include="Resources\ChartDefaultStyle.png" />
|
<None Include="Resources\ChartDefaultStyle.png" />
|
||||||
<None Include="Resources\ChartPlainStyle.png" />
|
<None Include="Resources\ChartPlainStyle.png" />
|
||||||
<None Include="Resources\SunnyLogin.png" />
|
<None Include="Resources\SunnyLogin.png" />
|
||||||
<None Include="Bin\Team\ajax.png" />
|
|
||||||
<None Include="Bin\Team\atalanta.png" />
|
|
||||||
<None Include="Bin\Team\barcelona.png" />
|
|
||||||
<None Include="Bin\Team\benfica.png" />
|
|
||||||
<None Include="Bin\Team\betis.png" />
|
|
||||||
<None Include="Bin\Team\brescia.png" />
|
|
||||||
<None Include="Bin\Team\chievo.png" />
|
|
||||||
<None Include="Bin\Team\deportivo.png" />
|
|
||||||
<None Include="Bin\Team\feyenoord.png" />
|
|
||||||
<None Include="Bin\Team\heerenveen.png" />
|
|
||||||
<None Include="Bin\Team\inter.png" />
|
|
||||||
<None Include="Bin\Team\lazio.png" />
|
|
||||||
<None Include="Bin\Team\mallorca.png" />
|
|
||||||
<None Include="Bin\Team\milan.png" />
|
|
||||||
<None Include="Bin\Team\parma.png" />
|
|
||||||
<None Include="Bin\Team\porto.png" />
|
|
||||||
<None Include="Bin\Team\psv.png" />
|
|
||||||
<None Include="Bin\Team\real_madrid.png" />
|
|
||||||
<None Include="Bin\Team\real_sociedad.png" />
|
|
||||||
<None Include="Bin\Team\roma.png" />
|
|
||||||
<None Include="Bin\Team\sevilla.png" />
|
|
||||||
<None Include="Bin\Team\udinese.png" />
|
|
||||||
<None Include="Bin\Team\valencia.png" />
|
|
||||||
<None Include="Bin\Team\villareal.png" />
|
|
||||||
<None Include="Bin\Team\zaragoza.png" />
|
|
||||||
<None Include="Resources\ajax.png" />
|
<None Include="Resources\ajax.png" />
|
||||||
<None Include="Resources\atalanta.png" />
|
<None Include="Resources\atalanta.png" />
|
||||||
<None Include="Resources\barcelona.png" />
|
<None Include="Resources\barcelona.png" />
|
||||||
|
@ -103,28 +103,18 @@ namespace Sunny.UI
|
|||||||
option.Title.SubText = "LineChart";
|
option.Title.SubText = "LineChart";
|
||||||
|
|
||||||
var series = option.AddSeries(new UILineSeries("Line1"));
|
var series = option.AddSeries(new UILineSeries("Line1"));
|
||||||
series.Add(0, 1.2);
|
for (int i = 0; i < 200; i++)
|
||||||
series.Add(1.1, 2.2);
|
{
|
||||||
series.Add(2.2, 3.2);
|
series.Add(i, 6 * Math.Sin(i * 3 * Math.PI / 180));
|
||||||
series.Add(3.3, 4.2);
|
}
|
||||||
series.Add(4.4, 3.2);
|
|
||||||
series.Add(5.5, 2.2);
|
|
||||||
series.Symbol = UILinePointSymbol.Square;
|
|
||||||
series.SymbolSize = 4;
|
|
||||||
series.SymbolLineWidth = 1;
|
|
||||||
series.SymbolColor = Color.Red;
|
|
||||||
|
|
||||||
series = option.AddSeries(new UILineSeries("Line2"));
|
series = option.AddSeries(new UILineSeries("Line2"));
|
||||||
series.Add(0.3, 3.3);
|
for (int i = 0; i < 150; i++)
|
||||||
series.Add(1.3, 2.3);
|
{
|
||||||
series.Add(2.3, 2.3);
|
series.Add(i, 6 * Math.Cos(i * 5 * Math.PI / 180));
|
||||||
series.Add(3.3, 1.3);
|
}
|
||||||
series.Add(4.3, 2.3);
|
|
||||||
series.Add(5.3, 4.3);
|
series.Smooth = true;
|
||||||
series.Symbol = UILinePointSymbol.Plus;
|
|
||||||
series.SymbolSize = 4;
|
|
||||||
series.SymbolLineWidth = 1;
|
|
||||||
series.SymbolColor = Color.Red;
|
|
||||||
|
|
||||||
option.XAxis.Name = "数值";
|
option.XAxis.Name = "数值";
|
||||||
option.YAxis.Name = "数值";
|
option.YAxis.Name = "数值";
|
||||||
@ -439,6 +429,7 @@ namespace Sunny.UI
|
|||||||
if (series.GetNearestPoint(e.Location, 4, out double x, out double y, out int index))
|
if (series.GetNearestPoint(e.Location, 4, out double x, out double y, out int index))
|
||||||
{
|
{
|
||||||
UILineSelectPoint point = new UILineSelectPoint();
|
UILineSelectPoint point = new UILineSelectPoint();
|
||||||
|
point.SeriesIndex = series.Index;
|
||||||
point.Name = series.Name;
|
point.Name = series.Name;
|
||||||
point.Index = index;
|
point.Index = index;
|
||||||
point.X = x;
|
point.X = x;
|
||||||
@ -477,7 +468,9 @@ namespace Sunny.UI
|
|||||||
selectPoints.Clear();
|
selectPoints.Clear();
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
foreach (var point in selectPointsTemp)
|
Dictionary<int, UILineSelectPoint> dictionary = selectPointsTemp.ToDictionary(p => p.SeriesIndex);
|
||||||
|
List<UILineSelectPoint> points = dictionary.SortedValues();
|
||||||
|
foreach (var point in points)
|
||||||
{
|
{
|
||||||
selectPoints.Add(point);
|
selectPoints.Add(point);
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ namespace Sunny.UI
|
|||||||
public UILineSeries AddSeries(UILineSeries series)
|
public UILineSeries AddSeries(UILineSeries series)
|
||||||
{
|
{
|
||||||
if (series.Name.IsNullOrEmpty()) return null;
|
if (series.Name.IsNullOrEmpty()) return null;
|
||||||
|
series.Index = Series.Count;
|
||||||
Series.TryAdd(series.Name, series);
|
Series.TryAdd(series.Name, series);
|
||||||
return series;
|
return series;
|
||||||
}
|
}
|
||||||
@ -45,7 +46,7 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
if (name.IsNullOrEmpty()) return null;
|
if (name.IsNullOrEmpty()) return null;
|
||||||
UILineSeries series = new UILineSeries(name);
|
UILineSeries series = new UILineSeries(name);
|
||||||
Series.TryAdd(series.Name, series);
|
AddSeries(series);
|
||||||
return series;
|
return series;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,6 +346,7 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
public struct UILineSelectPoint
|
public struct UILineSelectPoint
|
||||||
{
|
{
|
||||||
|
public int SeriesIndex { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
public int Index { get; set; }
|
public int Index { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user