Recent

Author Topic: [patch] allow to change legend border style and width in chart editor demo  (Read 3091 times)

Muso

  • Full Member
  • ***
  • Posts: 228
I noticed that the chart editor demo does not yet allow to set the legend border style and width.

Attached is a patch that add this functionality. Attached is the diff, the changed file and a screenshot how the dialog looks.

@wp, it this OK to go into Lazarus and if so could you please put it in?

wp

  • Hero Member
  • *****
  • Posts: 8747
The idea behind writing the ChartEditor demo was to demonstrate how a relatively simple GUI for user-editing of the most important properties of TChart and related components could be created. The emphasis is on "most important", not "all". An extremely complex GUI for chart properties is that of Delphi's TeeChart which addresses "all" properties, but has a pagecontrol inside a pagecontrol inside a pagecontrol inside a pagecontrol inside a pagecontrol - that's was not my intention.

In the current implementation of the demo the user can only hide the frame and change its color. I consider these to be the "most important properties" here. With your patch the entire user interface would become inconsistent. Why can I change the pen width of the legend, but not that of the title, footer, axis title, axis labels? This calls for applying your patch also to these chart elements. With every newly added feature the demo will move away from the original intention and approach the dialog of TeeChart.

Therefore, I will not apply your patch to the demo. Sorry to disappoint you, but if you need the feature add it to your local copy in your project. As I can see from your patch you understood the basics and can easily extend it.

BTW, once the storm related with the svn-to-git transition has settled down, I am planning to write a tutorial about the ChartEditor demo to explain the basic elements and to show how new features could be added.

Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Muso

  • Full Member
  • ***
  • Posts: 228
With your patch the entire user interface would become inconsistent. Why can I change the pen width of the legend, but not that of the title, footer, axis title, axis labels?

 :) I have to smile, because, can you imagine why I made the patch? - because the people testing my real-life program asked me why they can change for the series pointer the border style but not for the legend. I had a look and found that TAChart allows this. So for consistency I proposed the patch.

Also I am currently working to add this feature to the title/footer dialog, exactly for the same reason.

I fully agree with you not to address each and every setting, but since some parts of the chart Editor demo already offer a feature, I think it shold be available consistently for all parts of the demo.

Muso

  • Full Member
  • ***
  • Posts: 228
Also I am currently working to add this feature to the title/footer dialog, exactly for the same reason.

I finished this and now the ChartEditor demo allows consitently in all parts to change the border style and width. Since I assume you won't consider it for the official ChartEditor demo, I posted in this separate thread:
https://forum.lazarus.freepascal.org/index.php/topic,55627.0.html

that interested users can take it. My version includes your today's changes (support for title word wrap).

 

TinyPortal © 2005-2018