* UILineChart: 打开Smooth绘制,建议数据差距不大时可平滑绘制

This commit is contained in:
Sunny 2023-04-23 14:11:36 +08:00
parent 7938aa3854
commit 94ff3f35b3
2 changed files with 40 additions and 26 deletions

View File

@ -41,6 +41,7 @@
* 2022-08-17: V3.2.3 Nan时绘制出错
* 2022-09-19: V3.2.4 MouseZoom
* 2023-03-26: V3.3.3 X轴坐标时
* 2023-04-23: V3.3.5 Smooth绘制
******************************************************************************/
using System;
@ -479,9 +480,27 @@ namespace Sunny.UI
using (Pen pen = new Pen(color, series.Width))
{
g.SetHighQuality();
for (int i = 0; i < series.Points.Count - 1; i++)
if (series.ContainsNan || !series.Smooth || series.Points.Count == 2)
{
g.DrawTwoPoints(pen, series.Points[i], series.Points[i + 1], DrawRect);
for (int i = 0; i < series.Points.Count - 1; i++)
{
g.DrawTwoPoints(pen, series.Points[i], series.Points[i + 1], DrawRect);
}
}
else
{
try
{
g.DrawCurve(pen, series.Points.ToArray());
}
catch
{
for (int i = 0; i < series.Points.Count - 1; i++)
{
g.DrawTwoPoints(pen, series.Points[i], series.Points[i + 1], DrawRect);
}
}
}
g.SetDefaultQuality();

View File

@ -21,43 +21,38 @@
/******************************************************************************
* https://fontawesome.com/search?o=r&m=free
* https://fontawesome.com/license/free
* https://github.com/FortAwesome/Font-Awesome/blob/6.x/LICENSE.txt
******************************************************************************
UPDATED: JULY 12, 2018
Font Awesome Free License
-------------------------
Font Awesome Free is free, open source, and GPL friendly. You can use it for
Font Awesome Free is free, open source, and GPL friendly. You can use it for
commercial projects, open source projects, or really almost whatever you want.
Full Font Awesome Free license: https://fontawesome.com/license/free.
# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
packaged as SVG and JS file types.
Icons - CC BY 4.0 License
In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
packaged as .svg and .js files types.
# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL)
In the Font Awesome Free download, the SIL OFL license applies to all icons
Fonts - SIL OFL 1.1 License
In the Font Awesome Free download, the SIL OFL license applies to all icons
packaged as web and desktop font files.
# Code: MIT License (https://opensource.org/licenses/MIT)
In the Font Awesome Free download, the MIT license applies to all non-font and
Code - MIT License
In the Font Awesome Free download, the MIT license applies to all non-font and
non-icon files.
# Attribution
Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
Awesome Free files already contain embedded comments with sufficient
attribution, so you shouldn't need to do anything additional when using these
files normally.
Attribution
Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
Awesome Free files already contain embedded comments with sufficient
attribution, so you shouldn't need to do anything additional when using
these files normally.
We've kept attribution comments terse, so we ask that you do not actively work
to remove them from files, especially code. They're a great way for folks to
We've kept attribution comments terse, so we ask that you do not actively work
to remove them from files, especially code. They're a great way for folks to
learn about Font Awesome.
# Brand Icons
All brand icons are trademarks of their respective owners. The use of these
trademarks does not indicate endorsement of the trademark holder by Font
Awesome, nor vice versa. **Please do not use brand logos for any purpose except
to represent the company, product, or service to which they refer.
******************************************************************************/
using System;