TAChart: Add and AddXY methods lazarus / 55-TAChart ---------------------------------------------------------------------- wp · 2011-10-19 12:52 Being a lazy person I would appreciate if the parameters of the TSeries Add and AddXY methods would have default values, i.e. it should be possible to call Code: [Select]LineSeries1.AddXY(x,y,name) instead of Code: [Select]LineSeries1.AddXY(x,y,name,LineSeries.SeriesColor); The same for the other series accordingly. BTW: The multi-valued series (e.g. Box and Whisker series etc.) take advantage of the YList of the source. Having an additonal overloaded AddXY method with all required parameters would facilitate calling with the correct count and order of parameters by means of code completion: Code: [Select]function TBoxAndWhiskerSeries.AddXY(x, LWhisker,LBox,y,UBox,UWhisker:double) : integer; overload; ---------------------------------------------------------------------- Ask · 2011-10-19 15:04 Quoteparameters of the TSeries Add and AddXY methods would have default values I am actually unsure if it would be better to continue advertising series' Add/AddXY method or to refer users to the ListSource instead. Anyway, added defaults in r32984. (Note that the default color is clTAColor constant, not the Series.Color, since in the latter case the point will keep the color even if the Series.Color values changes, which it should not do by default). QuoteTBoxAndWhiskerSeries.AddXY I generally agree, but since I am not actually using "complex" multi- series myself, it is hard for me to judge the preferred API. Does your code actually have a place where you'd call this version of AddXY? Should it also include label/color parameters like original AddXY? Maybe a general AddXYList(x, y: array of const) would be useful also/instead? Should the order of y values be user-controllable, like in TOpenHighLowCloseSeries? ---------------------------------------------------------------------- wp · 2011-10-19 15:57 QuoteAnyway, added defaults in r32984. Thank you QuoteI am not actually using "complex" multi-series myself Actually I don't use these series either. The posting came to my mind because I am planning to write an ErrorbarSeries which will allow drawing error bars in x and/or y directions. The error values will be stored in the YList, and I just though it might be easier for the user to have a single call where everything is passed at once. QuoteShould it also include label/color parameters like original AddXY? Why not? QuoteI am actually unsure if it would be better to continue advertising series' Add/AddXY method or to refer users to the ListSource instead. I think having Add/AddXY as a method of the series helps when coming from Delphi although I have to admit that the advantages of working with the ListSource are buried to some degree. ---------------------------------------------------------------------- Ask · 2011-10-22 18:19 Added overload for box-and-whiskers as well as more general AddXY(x, y, ylist) overload in r33026-33027.