SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

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

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
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!
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

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

  • 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

P.S. Just like in your screenshot..

  • 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
Showing 8 results
Your Answer

Please first to submit.