ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Using NoAntiAlias with Chartdirector 7.1 version referencing SkiaSharp library
Posted by Erkki Holttinen on Nov-08-2023 18:26
Hi,

Setting the anti-alias with following call
XYChart.setAntiAlias(true, ChartDirector.Chart.NoAntiAlias);
does not seem to have impact on the rendered texts when running with the 7.1 version using SkiaSharp library. The rendered texts still has anti-alias enabled.
When running the same implementation against the 7.1 version using System.Drawing.Common library, the texts are rendered without anti-alias.

Is there something we can do to alter the behavior of how SkiaSharp is rendering the texts? Is this a bug in ChartDirector or is this a planned change to no longer support this option with SkiaSharp?

  Re: Using NoAntiAlias with Chartdirector 7.1 version referencing SkiaSharp library
Posted by Peter Kwan on Nov-10-2023 02:47
Hi Erkki,

Unluckily, we haven't implemented non-anti-alias text in SkiaSharp ChartDirector.

We expect SkiaSharp ChartDirector is used mostly for web applications with .NET Core or .NET 5 or later. We think the users would expect the text in the chart to be the same as the other text in the browser, which is normally anti-aliased. So we do not expect some applications would prefer non-anti-alias text.

Also, in the ChartDirector 7 sample code for .NET Core web applications, we have updated the code to send the chart to the browser in SVG (not as PNG/JPG). The SVG is rendered by the browser (not ChartDirector), just like any other part of the web page, and the browser normally will use anti-alias. The advantage of using SVG is that the browser will automatically resize the chart if the user choose to "zoom in" the web page, just like it would resize any other content in the chart.

If you do need to use non-anti-alias text, we can implement it in SkiaSharp ChartDirector too.

Best Regards
Peter Kwan

  Re: Using NoAntiAlias with Chartdirector 7.1 version referencing SkiaSharp library
Posted by Erkki Holttinen on Nov-10-2023 17:52
Hi Peter,

Thank you for the response.
Unlucky for us, we are using NoAntiAlias. We are currently in process of moving towards .NET 7 (or later), which means that we have a hybrid setup where some of the pipelines are running with .NET Framework 4.x and some with .NET 7. Since we have been using NoAntiAlias, we are now getting different rendering for the fonts depending of the pipeline, which just confuses our customers. Yes, there still would be other differences in the texts (like gap between characters seems to differ a bit between .NET Framwork 4.x, System.Drawing.Common with .NET Standard and SkiaSharp), but those are more subtle changes which are not that apparent.

We will take an internal discussion on how to proceed with this, i.e. should we change the policy of using anti-alias.

It would be nice, if the ChartDirector library would support NoAntiAlias in all situations, or at least there should be a notification in the documentation if it is not supported (tried to look for it but did not find any).

Regards,
Erkki Holttinen