I have made some progress on measuring tool -- I think it is good enough to be used.
Please test and tell if something is missing, especially compared to your version.
The text below is quite long -- feel free to answer partially and/or create a new topics for the parts which interest you.
The position of the DataPointCrosshairtool and DistanceTool cannot be changed once the tool operation is finished. I often want to reposition the endpoints of the distance tool to get better accuracy.
I do not think it is a problem for crosshair tool -- since there is only one point,
there is no difference between "editing" and "recreating" its position.
As for the distance tool, yes, I see that editing may be useful -- however this is another case of "easy to implement, but difficult to design".
I have one idea, which is good and generic, but perhaps an overkill:
1) Add "TDistanceSeries", which would display its data as a set of "distance measurements", similar to the way it is done in the current distance tool.
2) Use the existing TDragDropTool to edit the endpoints.
3) Add properties to the distance tool which would indicate the distance series and
action (add/replace).
The advantages of this plan are:
1) It will allow multiple simultaneous measurements, optionally with 'multi-hop' mode where the consecutive measurements are made along segments of polyline.
2) The current option of "permanent" distance is kind of a hack. The whole mechanism of tool drawing supposes that tools are transient -- visible only while active. Using the series for permanent data is architecturally better.
3) Editing, as said above.
4) Distance series may double as a "vector plot series" (see e.g.
http://www.sharpplot.com/Vectors.htm), or at least share code with it.
The disadvantages are:
1) Xor mode will be quite tricky to implement -- but I think manageable.
2) The setup will be somewhat complicated for the user. I hope I can find a way to offer current 'single-measure' functionality by default, with only 'multi-measure' and 'editing' requiring a series, but I did not yet thought it through.
a labelling tool which allows to place some text at an arbitrary location in the chart area.
This requires the definition of 'arbitrary location' first. For a long time, I have had the following design in mind:
1) Introduce TChartUnits type to select measurement units for coordinates and sizes -- already done.
2) Use TChartUnits in various places -- slowly started, but there are compatibility problems -- for example, "BarWidth" and "BarOffset" could probably use TChartUnits.
3) Add "TChartShape" class which is a basic class for an arbitrary shape with coordinates measured in TChartUnits. This will give user a large degree of control over shape positioning during the resizing/zooming/panning of the chart. See "Position" page of the axis demo for an example.
4) Add various descendants, the simplest being TRectChartShape, which would give you the label in a box.
However, there is a problem with the API: for each coordinate property, there must be corresponding "units" property. This may get quite cumbersome:
Top, TopUnits, Left, LeftUnits, Width, WidthUnits, Height, HeightUnits, etc.
Additionally, there may be a set of corresponding "UseXX" properties -- for example,
Width/UseWidth and Right/UseRight
I was planning to investigate the possibility to create a special type and/or a special OI editor to combine those 2 or 3 properties, but did not have the time yet.
Suggestions in this area are greatly appreciated.
a point labelling tool which allows to attach some text to a specific data point, in addition to the Marks.
This already can be done -- add new empty point series, use TDataPointClickTool,
add new point with the desired label in the OnClick handler.
Alternatively, simply edit Text field of the pointed data item -- this is simpler,
but obviously will not work to functional series.
I can easily implement TDataPointEditTool which does the above, but there is a problem with the data item editor. In most applications, this editor should have
domain-specific UI. I am not sure that the generic UI would be useful frequently
enough to warrant inclusion in TAChart. And without that UI, TDataPointEditTool is almost equal to TDataPointClickTool.
a line, an arrow, etc from the label to the data point.
A line already exists -- controlled by Marks.LinePen property.
As for arrows, they are very easy to add. However, I had an idea of possibility to implement callouts (see e.g.
http://www.nevron.com/gallery/FullGalleries/chart/Annotations/images/chart-rounded-rectangular-callout.png), which could cause conflict from the API point of view.
I am not sure about the relative value of having arrows now with a chance of compatibility problems later versus not having arrows for some time with a chance of more complete implementation in the indefinite future. My opinion on this matter may be easily influenced by you