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

Hello,

I am using StackedColumnRenderableSeries and I need annotations like in Histogram example:

enter image description here

    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var brushes = new Brush[] { Brushes.Red, Brushes.Green, Brushes.Blue, Brushes.Cyan, Brushes.Gray };
        var groups = new string[] { "Group 1", "Group 2", "Group 3" };
        var datas = new Dictionary<int, double[]>()
        {
            {1, new double[]{5.0, 4.0, 3.0, 2.0, 1.0}},
            {2, new double[]{1.0, 2.0, 3.0, 2.0, 1.0}},
            {3, new double[]{1.0, 2.0, 3.0, 4.0, 5.0}}
        };
        var data = new XyDataSeries<int, double>[brushes.Length];
        for (int i = 0; i < brushes.Length; i++)
        {
            data[i] = new XyDataSeries<int, double>();
        }
        foreach (var pair in datas)
        {
            for (int i = 0; i < pair.Value.Length; i++)
            {
                data[i].Append(pair.Key, pair.Value[i]);
            }
        }

        for (int i = 0; i < brushes.Length; i++)
        {
            var renderableSeries = new StackedColumnRenderableSeries()
            {
                Fill = brushes[i],
                DataSeries = data[i],
                StackedGroupId = brushes[i].ToString(),
            };
            sciChart.RenderableSeries.Add(renderableSeries);
        }
    }

How I can add annotation for each stacked grouped column? I attached the example with my Side-By-Side chart.

Ideally, I expected the annotations to be like in attached image.

Version
4.0.6.8482
Images
  • You must to post comments
0
0

Hi Ivan,

Thanks for your question. As to how make labels to appear on the top of every column, it isn’t possible out of the box. However, you could use Annotations for this. To calculate coordinates for them, try to call the AccumulateYValueAtX(IRendrableSeries, Index) method, provided by StackedColumnRenderableSeries.Wrapper. You will need to do this for every index of every series. Please take a look at this thread for more info:
http://www.scichart.com/questions/question/position-columns-between-data-values-for-stacked-series

Hope this helps!

Best regards,
Yuriy

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.