This is a migrated thread and some comments may be shown as answers.

Multi Yaxis by dynamical Series

6 Answers 93 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Lee asked on 24 Apr 2014, 06:54 AM
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.





6 Answers, 1 is accepted

Sort by
0
Klemens
Top achievements
Rank 1
answered on 24 Apr 2014, 12:12 PM
Hi,
have you looked here: Dynamic series and axis

Regards Markus

0
Lee
Top achievements
Rank 1
answered on 24 Apr 2014, 12:53 PM
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
0
Klemens
Top achievements
Rank 1
answered on 24 Apr 2014, 01:05 PM
So for a newly added series you want to add a new YAxis each time?

Regards Markus
0
Lee
Top achievements
Rank 1
answered on 24 Apr 2014, 04:02 PM
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.
0
Klemens
Top achievements
Rank 1
answered on 24 Apr 2014, 08:27 PM
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
0
Lee
Top achievements
Rank 1
answered on 25 Apr 2014, 12:46 AM
Thank you for your reply.

Yaxis is created each series.

Really, thank you.
Tags
ChartView
Asked by
Lee
Top achievements
Rank 1
Answers by
Klemens
Top achievements
Rank 1
Lee
Top achievements
Rank 1
Lee
Top achievements
Rank 1
Share this question
or