* UILineChart: 修改自定义X轴显示时,鼠标移上显示数据点标签

This commit is contained in:
yhuse
2025-08-11 22:56:50 +08:00
parent 2aab5a8998
commit a679bba8ef
3 changed files with 17 additions and 41 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -55,6 +55,7 @@
* 2024-07-01: V3.6.7 增加了Y轴自定义坐标显示
* 2024-11-13: V3.7.2 增加了鼠标移上绘制十字线样式
* 2024-11-14: V3.7.2 增加了鼠标移上绘制十字线颜色
* 2025-08-11: V3.8.7 修改自定义X轴显示时鼠标移上显示数据点标签
******************************************************************************/
using System;
@@ -954,6 +955,20 @@ namespace Sunny.UI
sb.Append(Option.XAxis.Name + ": ");
string customlabel = "";
if (Option.XAxis.HaveCustomLabels)
{
var customValues = Option.XAxis.CustomLabels.LabelValues();
for (int ci = 0; ci < customValues.Length; ci++)
{
if (customValues[ci].EqualsDouble(point.X))
{
customlabel = Option.XAxis.CustomLabels.GetLabel(ci);
sb.Append(customlabel);
break;
}
}
}
if (customlabel.IsNullOrEmpty())
{
if (Option.XAxisType == UIAxisType.DateTime)

View File

@@ -23,18 +23,8 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\Bin\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile></DocumentationFile>
<OutputPath>..\Bin\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
@@ -75,33 +65,4 @@
<PackageReference Include="SunnyUI.Common" Version="3.8.7" />
</ItemGroup>
<ItemGroup>
<Compile Update="Controls\UIDoubleUpDown.cs" />
<Compile Update="Controls\UIIntegerUpDown.cs" />
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>