![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | Background gradients do not draw correctly | ||
|---|---|---|---|
| Product: | .NET TeeChart | Reporter: | Brian Kohrs <bkohrs> |
| Component: | .NET 5.0 | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | chris |
| Priority: | --- | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | |
| Attachments: |
Examples of incorrect drawing
revised radial revised fromcenter |
||
The Radial issue was a defect in the SixLabors library which I reported here: https://github.com/SixLabors/ImageSharp.Drawing/issues/117 It is now fixed, I have updated the NuGet reference in our source-code to beta13, and it now works as expected. Created attachment 974 [details]
revised radial
Created using TeeChart.Server.dll and the following code:
static void Main(string[] args)
{
var chart = new TChart();
var area = new Area();
area.Add(1, 2);
area.Add(2, 3);
area.Add(3, 6);
chart.Series.Add(area);
chart.Panel.Brush.Gradient.Visible = true;
chart.Panel.Brush.Gradient.StartColor = Color.Red;
chart.Panel.Brush.Gradient.MiddleColor = Color.White;
chart.Panel.Brush.Gradient.EndColor = Color.Blue;
chart.Panel.Brush.Gradient.Style.Visible = true;
chart.Panel.Brush.Gradient.Style.Direction = PathGradientMode.Radial;
chart.Export.Image.PNG.Width = 800;
chart.Export.Image.PNG.Height = 600;
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "chart.png");
chart.Export.Image.PNG.Save(path);
new Process
{
StartInfo = new ProcessStartInfo(path)
{
UseShellExecute = true
}
}.Start();
}
Created attachment 975 [details]
revised fromcenter
Created using TeeChart.Server.dll and the following code:
static void Main(string[] args)
{
var chart = new TChart();
var area = new Area();
area.Add(1, 2);
area.Add(2, 3);
area.Add(3, 6);
chart.Series.Add(area);
chart.Panel.Brush.Gradient.Visible = true;
chart.Panel.Brush.Gradient.StartColor = Color.Red;
chart.Panel.Brush.Gradient.MiddleColor = Color.White;
chart.Panel.Brush.Gradient.EndColor = Color.Blue;
chart.Panel.Brush.Gradient.Style.Visible = true;
chart.Panel.Brush.Gradient.Style.Direction = PathGradientMode.FromCenter;
chart.Export.Image.PNG.Width = 800;
chart.Export.Image.PNG.Height = 600;
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "chart.png");
chart.Export.Image.PNG.Save(path);
new Process
{
StartInfo = new ProcessStartInfo(path)
{
UseShellExecute = true
}
}.Start();
}
Marked as fixed - although these Gradients produced by TeeChart.Server.dll are not identical to those produced by TeeChart.WinForm.dll, we believe them to be acceptable given these two assemblies use different graphics libraries. |
Created attachment 972 [details] Examples of incorrect drawing When using Gradient.Style, neither of the PathGradientMode options draw correctly. Using a .NET 5 console application with the latest Steema.TeeChart.NET NuGet package (4.2021.6.23), the following code will demonstrate the issue. When set to Radial, it draws a starburst pattern (and it takes a very long time to generate). When set to FromCenter, it draws a solid square, leaving one edge with a transparent background. var chart = new TChart(); var area = new CustomArea(); area.Add(1, 1); area.Add(2, 2); area.Add(3, 5); chart.Panel.Brush.Gradient.Visible = true; chart.Panel.Brush.Gradient.Style.Visible = true; chart.Panel.Brush.Gradient.Style.Direction = PathGradientMode.Radial; chart.Series.Add(area); chart.Export.Image.PNG.Width = 800; chart.Export.Image.PNG.Height = 600; chart.Export.Image.PNG.Save("test.png"); I have attached an image with both examples.