Recent

Author Topic: Proble with chart marks in LazReport  (Read 4757 times)

Apiotr

  • Newbie
  • Posts: 5
Proble with chart marks in LazReport
« on: January 25, 2019, 09:11:02 pm »
Probably the bug in LazReport.
I have a project which uses lazreport. I would like to print a chart with line series. I have used a method described in demo attached to lazreport components. If the chart is without marks the preview and print are perfect. But, when I turn on the marks, the vertical scale is wrong. For example, my highest point is -0.06 (fig. 1), but in LazReport print preview on the left (vertical axis) the numbers are from 100 to 800. I think that the problem is with TScaledCanvasDrawer. I have tried the second method using PaintOnCanvas and all is OK, however the resolution of print is bad.
Fig.1 – Chart with marks (Lazarus Form)
Fig.2 – LazReport print preview

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Proble with chart marks in LazReport
« Reply #1 on: January 25, 2019, 09:43:43 pm »
Which Lazarus/FPC version are you using? On which widgetset? If you use Laz/trunk please update from svn - there were a few recent changes related to series labels.

Does the bug appear only when you print a chart out of fpreport, or also when you print directly to the printer (like in tachart/demo/print)?

Please post a small demo which shows the issue. Pack source files (*.pas, *.lfm, *.lpr, *.lpi) to a common zip which you can upload here via "Attachments and other options". Don't include compiler-generated files like *.exe or *.ppu - otherwise the upload will become too large.

« Last Edit: January 25, 2019, 09:47:26 pm by wp »

Apiotr

  • Newbie
  • Posts: 5
Re: Problem with chart marks in LazReport
« Reply #2 on: January 25, 2019, 10:51:14 pm »
Lazarus 2.0 RC3. LazReport included in this version.

Apiotr

  • Newbie
  • Posts: 5
Re: Proble with chart marks in LazReport
« Reply #3 on: January 25, 2019, 11:09:50 pm »
I have checked a direct printing from tachart/demo/print. The result is similar, but no as big as when I print out of LazReport. I attach two figures with and without marks. This time is a problem with size of font in marks.

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Proble with chart marks in LazReport
« Reply #4 on: January 26, 2019, 12:57:49 am »
You are right - there was still a bug in the calculation of the mark margins: some contributions were scaled twice.
It is fixed in trunk now and will be backported to v2.0.

As for the too-small series marks in the print demo: This is because the default font size is zero which is replaced for the screen canvas automatically by the size of the system font; but it does not happen for the drawing backends. You can solve it by selecting a non-zero font size, e.g. 10, for the series Marks.LabelFont.

Apiotr

  • Newbie
  • Posts: 5
Re: Proble with chart marks in LazReport
« Reply #5 on: January 26, 2019, 03:54:04 pm »
Thank You very much!! Now the print and print preview are perfect!  I have used a corrected version from trunk.

 

TinyPortal © 2005-2018