Recent

Author Topic: primary Questions about TChart  (Read 10049 times)

wp

  • Hero Member
  • *****
  • Posts: 12476
Re: primary Questions about TChart
« Reply #15 on: February 27, 2024, 12:35:56 am »
I think you are wanting the TUserDefinedSeries to do something it was not designed for. Maybe it would be better to create a new series type so that you have access to the series variables. This is not too difficult. When the series descends from TBasicPointSeries it inherits all the data handling, all you have to do is to override the Draw(ADrawer) method. You can use the code from TAreaSeries or TLineSeries as a reference. Add properties for the reference level at which the color changes, as well as the brushes and pens above and below the reference line. Maybe just like in attached demo.

« Last Edit: February 27, 2024, 12:39:03 am by wp »

Tulurdes

  • Newbie
  • Posts: 3
Re: primary Questions about TChart
« Reply #16 on: February 27, 2024, 05:32:47 pm »
Awesome code you've sent, thank you! it gave me some ideas to another problem that I'll be facing in the future

I've thought of that, but wanted to see if there was something that I was missing.

I was studying TAChart code and seems to me that makes more sense to update the tachart package, at least for the TLineSeries the TAreaSeries is a little more complex, will take a litte more time.

I've made TLineSeries work like a charm with minimal changes (wouldn't break any compatibility).
Now I'll try to figure out how can I send a suggestion of improvement to the official Dev team, maybe they can include this to the official release so more people can benefit from this functionality.

If you know how to do this kind of suggestion, I'd appreciate also.

wp

  • Hero Member
  • *****
  • Posts: 12476
Re: primary Questions about TChart
« Reply #17 on: February 27, 2024, 05:57:46 pm »
Send feature requests or bug reports to the GitLab bug tracker (https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues). Mention "TAChart" in the title of the report - this makes it easier for me to identify it. Carefully describe the issue, add a project to demonstrate the issue, ideally add a patch so that I can see what you want to modify in the code.

seems to me that makes more sense to update the tachart package, at least for the TLineSeries the TAreaSeries is a little more complex
Hmmm... you are talking about the 2-color feature? I think I would not add it to the standard TLineSeries or TAreaSeries because I am rather sure that most users will not need it. One possible option could be to create a "TAChartExtraSeriesPackage" with additional series types, rarely used, but maybe too complex for the average user to write it him/herself.
« Last Edit: February 27, 2024, 06:11:44 pm by wp »

Tulurdes

  • Newbie
  • Posts: 3
Re: primary Questions about TChart
« Reply #18 on: February 27, 2024, 07:04:39 pm »
Thanks a Lot!

Actually what I've done is add a color each option (ceZeroLevel) Just sent a bug tracker named "TAChart improvement suggestion on the TLineSeries"
I think you will like the approach. Didn't knew you where the responsible for TAChart, what an honor.

I'm not an average user (I think), been programming for the past 24 years, I'm just dont have experience with git and stuff, been mostly a lone dev.

Thanks again for all the help and attention.
I really hope you like the suggestion

 

TinyPortal © 2005-2018