Forum > TAChart
adding text to line chart points
(1/1)
Firebird:
Is there a way to "annotate" points in a line chart? I would like to add a string to each point as to "code" these points. In other words I would like to add data points as (x,y,text).
wp:
That's what it's made for:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Chart1LineSeries.AddXY(x, y, datapt_label, datapt_color); // title and color optional
In order to display the data point labels, you must switch the series' Marks.Style to smsLabel (if you do this by code you must add unit TAChartUtils). There are other Marks.Style values which select various aspects of a data point - see https://wiki.lazarus.freepascal.org/TAChart_documentation#Mark_labels
Firebird:
Thanks wp that really helps.
Navigation
[0] Message Index