Multi Yaxis by dynamical Series

7 posts, 0 answers
  1. Lee
    Lee avatar
    5 posts
    Member since:
    Mar 2014

    Posted 24 Apr 2014 Link to this post

    My Series data is decided in run-time.

    Below my xaml code.

                <telerik:RadCartesianChart.SeriesProvider>
                    <telerik:ChartSeriesProvider Source="{Binding Series}">
                        <telerik:ChartSeriesProvider.SeriesDescriptors>
                            <telerik:CategoricalSeriesDescriptor ItemsSourcePath="Data" ValuePath="Value" CategoryPath="Time" >
                                <telerik:CategoricalSeriesDescriptor.Style>
                                    <Style TargetType="telerik:LineSeries">
                                        <Setter Property="StrokeThickness" Value="1"/>
                                        <Setter Property="Visibility" Value="{Binding Name , Converter={StaticResource pointFocusConverter}}"/>
                                        <Setter Property="LegendSettings">
                                            <Setter.Value>
                                                <telerik:SeriesLegendSettings Title="{Binding Name}"/>
                                            </Setter.Value>
                                        </Setter>
                                        <Setter Property="VerticalAxis">
                                            <Setter.Value>
                                                <telerik:LinearAxis/>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </telerik:CategoricalSeriesDescriptor.Style>
                            </telerik:CategoricalSeriesDescriptor>
                        </telerik:ChartSeriesProvider.SeriesDescriptors>
                    </telerik:ChartSeriesProvider>
                </telerik:RadCartesianChart.SeriesProvider>


    In this code, 'StrokeThickness', 'Visibility' and 'LegendSettings' is confirmed binding
    According to other code,  'VerticalAxis' property is dynamically making Yaxis.
    But does not working.
    Please help me.





  2. Markus
    Markus avatar
    42 posts
    Member since:
    Nov 2012

    Posted 24 Apr 2014 Link to this post

    Hi,
    have you looked here: Dynamic series and axis

    Regards Markus

  3. UI for WPF is Visual Studio 2017 Ready
  4. Lee
    Lee avatar
    5 posts
    Member since:
    Mar 2014

    Posted 24 Apr 2014 in reply to Markus Link to this post

    Thank you for your reply.

    but this sample don't have that I want.

    the sample is creating Yaxis such as below.

    <.cs code>
    this.SalesData.Add(this.CreateVM());
    this.SalesData.Add(this.CreateVM());
    this.SalesData.Add(this.CreateVM());

    but I want to create only XAML code, is it impossible?

    because number of my series is unkown, it is created dynamically
  5. Markus
    Markus avatar
    42 posts
    Member since:
    Nov 2012

    Posted 24 Apr 2014 Link to this post

    So for a newly added series you want to add a new YAxis each time?

    Regards Markus
  6. Lee
    Lee avatar
    5 posts
    Member since:
    Mar 2014

    Posted 24 Apr 2014 in reply to Markus Link to this post

    Thank you for your reply.

    No each time.

    But when chart is refreshed, automatically it is created.

    don`t have c# code

    only WAML code.
  7. Markus
    Markus avatar
    42 posts
    Member since:
    Nov 2012

    Posted 24 Apr 2014 Link to this post

    Hi, I think best paractise here is to make a collection of the axis you want. For example List<LienarAxis>. Here you can add or remove axis dynamicaly. The last step is to bind the added series to one of the list items. <Setter Property="VerticalAxis" Value="{Binding VAxis}">

    Regards Markus
  8. Lee
    Lee avatar
    30 posts
    Member since:
    Apr 2014

    Posted 24 Apr 2014 in reply to Markus Link to this post

    Thank you for your reply.

    Yaxis is created each series.

    Really, thank you.
Back to Top
UI for WPF is Visual Studio 2017 Ready