Pre loader

VerticalLineAnnotation rendering to false positions first

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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

Images
  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

P.S. Just like in your screenshot..

  • You must to post comments
0
0

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

  • You must to post comments
0
0

Ps.: I also set the labels to be positioned on the axis instead of top

  • You must to post comments
0
0

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

  • You must to post comments
0
0

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

  • You must to post comments
0
0

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

  • You must to post comments
Showing 9 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies