0
votes

I have the following code in WPF:

<telerikNavigation:RadTileViewItem Header="New Synonyms">
    <ScrollViewer>
        <Grid ScrollViewer.CanContentScroll="True">

            <telerik:RadCartesianChart>
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:CategoricalAxis />
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis/>
                </telerik:RadCartesianChart.VerticalAxis>

                <telerik:RadCartesianChart.Series>
                    <telerik:BarSeries Name="barSeriesNewSynonyms">
                        <telerik:BarSeries.DataPoints>
                            <telerik:CategoricalDataPoint Category="hello" Value="10" />
                            <telerik:CategoricalDataPoint Category="hi" Value="5" />
                        </telerik:BarSeries.DataPoints>
                    </telerik:BarSeries>
                </telerik:RadCartesianChart.Series>
            </telerik:RadCartesianChart>


        </Grid>
    </ScrollViewer>
</telerikNavigation:RadTileViewItem>

and it seems like this:
enter image description here
The scrollViewer does not work. I also have change the above code in a way that the scrollviewer was embedded inside the Grid but it gave me the same result. How can the scroll embed the entire content in the grid so all of the content can be visible.
I want to use ScrollViewer to fit the items inside it. As it can be seen, the scrollviewer does not appear and does not work. The following image shows that every thing is embedded without the need of scroll, but the size changes and I need to have scroll bars.
enter image description here
I have updated the content of the chart by using the following C# code:

this.barSeriesOldSynonyms.DataPoints.Clear();
foreach (var it in osr.previousMeanings)
    this.barSeriesOldSynonyms.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint() { Category = it.word.ToString(), Value = it.frequency });
1
can you post code showing how you are updating the DataPoints in the wpf to the ones in your screenshot? - tolanj
@tolanj check the updates - Green Falcon
RadCartesianChart seems to have its own scrolling behaviours, look at: docs.telerik.com/devtools/wpf/controls/radchartview/features/… - tolanj

1 Answers

1
votes

RadCartesianChart seems to have its own scrolling behaviours, look at here.
In summary you can set

<telerikChart:RadCartesianChart.Behaviors>
   <telerikChart:ChartPanAndZoomBehavior PanMode="Both" />
</telerikChart:RadCartesianChart.Behaviors>

to get 2 scrollbars.