Questions regarding export charts to various formats

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Justin
Newbie
Newbie
Posts: 5
Joined: Mon Aug 28, 2023 12:00 am

Questions regarding export charts to various formats

Post by Justin » Mon Oct 02, 2023 9:21 am

Hello,

We started to develop charts and have some questions regarding export:

1) For generating charts, we have strict rules, like which font size, line weight, etc. should be in some of them. We would like, that for previewing and for printing the image would not pixelate - we need to scale such image depending on dpi (from 300 - 1200dpi) for printing. On export, there is an option for width & height, we tried to increase it, but it looks like it just increased the image area, but font sizes or line width stayed the same. Does TeeChart have the functionality to scale images so that all font sizes, line weights, and other elements would scale accordingly on exporting JPEG or other formats?

2) For image proper scaling, we tried to use vector format and export the chart to SVG format. For the Pie type chart we see, that the circle line doesn't seem smooth. It looks like it was created from multiple lines. Is there any option, that would help to solve that Pie type chart would be smooth? Attached image pieChart.png

3) For chart type Line, after we increase the line width it starts to be visible, that two lines join have some white gaps. The more sharper the line connects another line, the more it is visible. Looks like, two rectangles were drawn without filling a smooth connection between them. There is a smooth option, but it creates an overall smoother chart, not between two connecting lines. How we can achieve, a nice connection between to lines so that it would not have gaps (or cut effect)? attachment linesConnectino.png

4) We tried to export the chart to different formats, and noticed, that for some formats it cuts images or has differences in drawing lines. On export to JPEG there aren't any vertical lines, but for SVG or EPS format it has. Does it mean, that for each export type, we should have different handling settings to get the same result? attached files: line_diffrencies.png, line_diffrencies.png

5) We tried to export the chart to EPS format with custom free font. This font is imported into Adobe Illustrator, so we tried to open it and Adobe Illustrator didn't recognize this font from EPS file. We tried to export to other formats, for JPEG font looks correct, but for SVG it's different. How to ensure, that the same fonts are used, regardless of which format we export the chart?
Attachments
line_diffrencies.png
line_diffrencies.png (124.15 KiB) Viewed 18593 times
linesConnection.png
linesConnection.png (135.98 KiB) Viewed 18593 times
pieChart.png
pieChart.png (56.53 KiB) Viewed 18593 times

Newbie
Newbie
Posts: 1
Joined: Mon Aug 28, 2023 12:00 am

Re: Questions regarding export charts to various formats

Post by » Mon Oct 02, 2023 3:23 pm

Additional information for
2)
We also see the Pie Chart Edge problem with PDF output *some* of the time when using Chart Export in WinForms designer. (It seems to be intermittent and sometimes has a smooth pie edge arc)

Addition information for
3)
In WinForms chart editor running on .NET 7 WinForms app we see there is a "rounded corners" option that seems to solve this problem however, this option does not seem to work when running the same NuGet package in a ASP.NET 7 Web API app.

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Questions regarding export charts to various formats

Post by Marc » Tue Oct 03, 2023 8:42 am

Hello,

Re.
3) For chart type Line, after we increase the line width it starts to be visible, that two lines join have some white gaps. The more sharper the line connects another line, the more it is visible. Looks like, two rectangles were drawn without filling a smooth connection between them. There is a smooth option, but it creates an overall smoother chart, not between two connecting lines. How we can achieve, a nice connection between to lines so that it would not have gaps (or cut effect)? attachment linesConnectino.png
You can modify the line endings:
eg.

Code: Select all

line1.LinePen.EndCap = System.Drawing.Drawing2D.LineCap.Round;
Regards,
Marc Meumann
Steema Support

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Questions regarding export charts to various formats

Post by Marc » Tue Oct 03, 2023 10:35 am

Hello,

There are several issues here that we are looking at. Some that are subject to design limitations, some for which we may be able to offer a workable approach for your requirements and at least one other that we may be able to add as a feature improvement. We will get back to this thread on each point.

Regards,
Marc
Steema Support

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Questions regarding export charts to various formats

Post by Marc » Wed Oct 04, 2023 6:51 pm

Hello,

Here's a review of your questions:

Re. 1
Does TeeChart have the functionality to scale images so that all font sizes, line weights, and other elements would scale accordingly on exporting JPEG or other formats?
For bitmap formats such as JPEG & PNG, no. This to be automatic it would need to be done via vector formats such as SVG or PDF. We have run a few tests on resizing fonts when the canvas size is increased but work in this area would require further time. There is the option to manually include changes in the client project .. if width or height > x then font size = y .... That would require to be done for the key text elements of the Chart. In general it can be accomplished by controlling Axis Label, Series Mark, Titles and Legend text plus any tool or custom elements that have been added. Controlling a PNG export in this way may be the best solution.

Re. 2
Pie Chart Edge problem [with PDF and SVG]
Pie borders are currently rendered as a series of short polygons. For normal viewing sizes this is not an issue particularly when anti-aliased. We haven't seen symptoms as marked as your example but understand for a hugely expanded image that could occur as each polygon comes from 1º of the circumference. We will examine this area and could respond in two ways: either to increase the resolution (polygon frequency) or look to introduce an arc-path. The latter would be the better solution; we'll take a look.

Re. 3
Line-end rounding. Fails to work in NuGet package in a ASP.NET 7 Web API app
We'll take a look.

Re. 4
We tried to export the chart to different formats, and noticed, that for some formats it cuts images or has differences in drawing lines.
I noticed some issues on overall rectangle clipping and sizing that has been resolved during those tests. We'll need some specific example-code or project for your other observations (eg. no vertical line issue on JPEG export . does that refer to grid lines?). Some code to help reproduce the output t in your attached image would help us get nearer to the case of the issue.

Re. 5.
export the chart to EPS format with custom free font.
Currently pending checks


In relation to your list of points, we're working on the areas where we think we can make improvements. You have reported on several image types. Do you have a preference for a format to use?

What version of Visual Studio NET and with which framework[s] are you working? (I saw NET7 referenced as one)

With thanks.
Regards,
Marc Meumann
Steema Support

Justin
Newbie
Newbie
Posts: 5
Joined: Mon Aug 28, 2023 12:00 am

Re: Questions regarding export charts to various formats

Post by Justin » Thu Oct 05, 2023 1:18 pm

You have reported on several image types. Do you have a preference for a format to use?
Vector format: EPS or SVG

Re. 4
Some code to help reproduce the output t in your attached image would help us get nearer to the case of the issue.
Exported chart template and data - I hope it will help to find the issue. Added SVG and JPEG to see the additional lines. Added everything to chart.zip

Attached two images side by side
Attachments
additionalLines.png
additionalLines.png (91.05 KiB) Viewed 18374 times
chart.zip
(19.89 KiB) Downloaded 431 times

Justin
Newbie
Newbie
Posts: 5
Joined: Mon Aug 28, 2023 12:00 am

Re: Questions regarding export charts to various formats

Post by Justin » Mon Oct 09, 2023 12:04 pm

In my previous reply, I exported a template with data. Is it enough to reproduce the issue regarding additional vertical lines in SVG export? I have another example, probably related to the same issue. I have tried to generate JPEG and SVG and it has a huge difference. Do we need to set up a different Chart for each export format? Ideally, we would like to have the chart preview to use JPEG and generate SVG/EPS to be able to scale the chart. Adding templates with data in the attachment.

Pie chart example:
pie_issueRelated.png
pie_issueRelated.png (177.14 KiB) Viewed 18240 times
a) Is there a way, to ensure that texts do not overlap? Thailand, Cash in this example
b) On the right side we have SVG and it's totally different from JPEG format. How to control, that it would be the same? For some reason, it cuts the chart from all sides. (The header title for some reason is much closer to the pie chart).
c) Different line colors compared to JPEG and in some areas line goes beyond the circle main line. How to ensure consistency between formats?

Any news regarding:
- Pie Chart Edge issue? It was mentioned, that it would be resolved by increasing the resolution or introduction of an arc-path.
- Custom fonts for EPS investigation.

We use Steema.TeeChart.NET (4.2023.8.31)
Microsoft Visual Studio Professional 2022 (64-bit) - Version 17.5.3
Attachments
pie issue.zip
(45.63 KiB) Downloaded 424 times
bar issues.zip
(39.21 KiB) Downloaded 423 times

Justin
Newbie
Newbie
Posts: 5
Joined: Mon Aug 28, 2023 12:00 am

Re: Questions regarding export charts to various formats

Post by Justin » Mon Oct 09, 2023 12:12 pm

Could not add a bar chart example in an earlier post (I guess file limitation to attach).
bars_issueRelated.png
bars_issueRelated.png (163 KiB) Viewed 18239 times
a) The line color is different depending on the format. How to ensure the same color?
b) For a 3D bar chart, the grid two-line connection has white space between them. Are there any options to connect more smoothly?
c) why is the initial height different compared JPEG to SVG? How to set SVG, so that it would be exactly the same as in JPEG?

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Questions regarding export charts to various formats

Post by Marc » Tue Oct 10, 2023 7:44 am

Thank you for the additional feedback. We're working through the points you've raised. Some issues have been resolved or are being worked on; improvements will be made to SVG export. We have currently not entered into checks on the Custom fonts for EPS question.

Re.
a) Is there a way, to ensure that texts do not overlap? Thailand, Cash in this example
The marks should render ok if Marks.AutoMarkPosition = true;

Tests correctly for jpeg and svg when run here

Regards,
Marc
Steema Support

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Questions regarding export charts to various formats

Post by Marc » Sun Oct 15, 2023 10:14 am

Progress report:

2 improvements will be included with an update build this week:
Steema Support

Justin
Newbie
Newbie
Posts: 5
Joined: Mon Aug 28, 2023 12:00 am

Re: Questions regarding export charts to various formats

Post by Justin » Thu Oct 19, 2023 5:18 am

Returning to the lines connection issue.
linePen_with_endGap.png
linePen_with_endGap.png (76.96 KiB) Viewed 16173 times
I've tried to set

Code: Select all

line1.LinePen.EndCap = System.Drawing.Drawing2D.LineCap.Round;
but couldn't achieve that lines would look more properly connected.

Maybe there is some combination that prevents rounding the end cap settings? Attached exported template and data which is the result of my attached chart image.
Attachments
data_and_template.zip
(14.96 KiB) Downloaded 357 times

Post Reply