TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gargi Patil
NA
63
3.9k
Annotation should be update while moving cursor.
May 20 2021 12:16 PM
Hello,So I have created a PointLineSeries in LightningChart, and I would like to add annotations to the line when I hover the mouse over it. I have written code to show the annotion box and it moves when I move the cursor, but it is blank. How can I add the value to this box? Any help would be appreciated.
private
void
UpdateCursorResult()
{
_updatedCursorResults =
true
;
_chart.BeginUpdate();
LineSeriesCursor cursor = _chart.ViewXY.LineSeriesCursors[0];
AnnotationXY annot = _chart.ViewXY.Annotations[0];
float
targetYCoordinate = DpiHelper.DipToPx((
float
)_chartViewXY.GetMarginsRect().Bottom);
double
y;
_chart.ViewXY.YAxes[0].CoordToValue(targetYCoordinate,
out
y,
false
);
annot.TargetAxisValues.X = cursor.ValueAtXAxis;
annot.TargetAxisValues.Y = y;
double
seriesYValue = 0.0;
StringBuilder sb =
new
StringBuilder();
int
seriesNumber = 1;
char
c =
'A'
;
string
channelStringFormat =
"Product {0}: {2,5}"
;
string
value =
""
;
AxisY yAxis =
null
;
foreach
(PointLineSeries series
in
_chart.ViewXY.PointLineSeries)
{
value =
""
;
seriesYValue = GetTotalSum((
int
)cursor.ValueAtXAxis, (Product)(seriesNumber - 1));
yAxis = _chart.ViewXY.YAxes[series.AssignYAxisIndex];
value =
string
.Format(channelStringFormat, c, ConvertToCurrencyString(seriesYValue));
sb.AppendLine(value);
seriesNumber++;
c++;
}
channelStringFormat =
"Total sales: {0,8}"
;
value =
string
.Format(channelStringFormat, ConvertToCurrencyString(GetTotalSum((
int
)cursor.ValueAtXAxis)));
sb.AppendLine(
""
);
sb.AppendLine(value);
annot.Visible =
true
;
_chart.EndUpdate();
}
Reply
Answers (
0
)
Need use LIKE %
Checking if specific columns data exists in a different workbook c# ..