Hi!
I want to create a graph, where vertical line annotations are displayed at each column of a chart. I
have the vertical line annotations created like this:
xaml:
code behind
statisticsChartAnnotations = new AnnotationCollection();
Style sliceStyle = App.Current.FindResource("sliceStyle") as Style;
if (displayedChartSeries.Count > 0)
{
foreach (DateTime datapoint in displayedChartSeries[0].DataSeries.XValues)
{
VerticalLineAnnotation a = new VerticalLineAnnotation()
{
Style = sliceStyle,
X1 = datapoint,
IsEnabled = false,
};
StatisticsChartAnnotations.Add(a);
}
}
But when I display the first chart, the annotations are displayed by an offset from the columns. When i switch to the next chart, the annotations jump to the right positions. I attached a picture of the problem. First charts shows the initial positions.
I already tried refreshing the surface through viewportmanager and dataseries. Is this a known bug? is there any workaround? Is there a way to render the annotations right to the data points?
Thanks,
Kristóf
- Kristóf Czimer asked 8 years ago
- You must login to post comments
Ps.: I also set the labels to be positioned on the axis instead of top
- Kristóf Czimer answered 8 years ago
- You must login to post comments
Hi Kristóf,
Thank you for your reply.
Yes in that case it works. I mean if you only need the label on the X axis , but if you try to put the label on “Top” and show the whole vertical line, you should be able reproduce the problem.
I have tried without success to find out what happening , but I feel its something to do with the LabelPlacement , VerticalLineAnnotaton and its AnnotationLabel and the Width..
Kind Regards
Giuseppe
- jp13 answered 8 years ago
- You must login to post comments
Hi,
I have been able to reproduce the issue in a sample solution..
It seems to depend all if the annotations is set to hidden, placed and after shown.
Opening an ticket and sending the solution to support guys.
- jp13 answered 8 years ago
- You must login to post comments
Hi,
I have been able to reproduce the issue in a sample solution..
It seems to depend all if the annotations is set to hidden, placed and after shown.
Opening an ticket and sending the solution to support guys.
- jp13 answered 8 years ago
- You must login to post comments
I doubt that this will work. I have had 2 capstone writers review this and they have said this is impossible to run. I believe in your expertise but they are also professional in tier field and understand everything.
- Celestine Rau answered 3 years ago
- You must login to post comments
Hi Kristóf,
We’re not aware of any bugs in VerticalLineAnnotation that would cause them to be positioned incorrectly. If you look at your Visual Studio Output Window, do you see any warnings or error messages from SciChart?
Best regards,
Andrew
- Andrew Burnett-Thompson answered 8 years ago
- You must login to post comments
Hi ,
My name is Giuseppe , sorry for entering in this topic but I am experiencing the same issue as Kristóf.
Vertical lines are positioned where they should be only after a zoom or refresh on the chart surface.
In my app I have noticed that the offset amount is not proportional but is greater as the Vertical lines
go to the right of the chart. (as in my chart I must put at least 100 vertical lines)
Until now I haven’t been able to recreate the issue in a separate example solution, I was just wandering if Kristóf has done this. ?
Kind Regards ,
Giuseppe
- jp13 answered 8 years ago
- You must login to post comments
Hi!
I dont recall any warnings. I actually did not need the whole line annotation, just its label. I set the width of the annotation to 0. And now the labels are positioned at the correct places, just below the data points, no offset.
Best regards,
Kristóf
- Kristóf Czimer answered 8 years ago
- You must login to post comments
Please login first to submit.