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

RadCartesianChart.VerticalAxis

1 Answer 67 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Hila
Top achievements
Rank 1
Hila asked on 29 May 2016, 12:41 PM

Hey,

 

I'm trying to create RadCartesianChart that on VerticalAxis and HorizontalAxis have DateTimeCategoricalAxis.

In the HorizontalAxis should be the date and in the VerticalAxis should be the Hours and Minutes.

Attached my view, I'm working on it over a week and still can't find the answer to this issue.

<------------------------------------------------>

  <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <telerik:RadLegend x:Name="legend1"
                           HorizontalAlignment="Right"
                           Width="100"
                           Items="{Binding LegendItems, ElementName=Chart1}"
                           Style="{DynamicResource RadLegendStyle1}"
                           Margin="0,239.5,0,215.5">
            <telerik:RadLegend.ItemTemplate>
                        <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                        <Border Width="12"
                        Height="3"
                        BorderBrush="Black"
                        CornerRadius="0"
                        Background="{Binding MarkerFill}" />

                        <TextBlock Margin="2"
                        Text="{Binding Title}" />
                        </StackPanel>
                        </DataTemplate>
            </telerik:RadLegend.ItemTemplate>
        </telerik:RadLegend>
        <telerik:RadCartesianChart x:Name="Chart1"
                                   Grid.Column="1"
                                   Palette="{StaticResource customPalette}"
                                   Style="{DynamicResource StyleRadCartesianChartSeriesPoint}">
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis LabelFormat="dd - MM - yy"
                                                 DateTimeComponent="Month"/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:DateTimeCategoricalAxis LabelFormat="HH : mm" />
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="Y" />
            </telerik:RadCartesianChart.Grid>
            <telerik:PointSeries PointTemplate="{StaticResource PointTemplate2}"
                                 ItemsSource="{Binding valueBarPoints}"
                                 CategoryBinding="Datee"
                                 ValueBinding="Time">
                <!--<telerik:PointSeries.DataPoints>
                    <telerik:CategoricalDataPoint Category="January"
                                                  Value="4" />
                    <telerik:CategoricalDataPoint Category="February"
                                                  Value="7" />
                    <telerik:CategoricalDataPoint Category="March"
                                                  Value="5" />
                    <telerik:CategoricalDataPoint Category="April"
                                                  Value="6" />
                    <telerik:CategoricalDataPoint Category="May"
                                                  Value="12" />
                    <telerik:CategoricalDataPoint Category="June"
                                                  Value="9" />
                    <telerik:CategoricalDataPoint Category="July"
                                                  Value="3" />
                </telerik:PointSeries.DataPoints>-->
                <telerik:PointSeries.LegendSettings>
                    <telerik:SeriesLegendSettings Title="List 2" />
                </telerik:PointSeries.LegendSettings>
            </telerik:PointSeries>

        </telerik:RadCartesianChart>

    </Grid>

<--------------------------------------------------->

 

 

 

Thanks,

Hila.

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 30 May 2016, 06:49 AM
Hi Hila,

As explained in our online documentation, we have essentially two types of series - scatter and categorical. Scatter series require two numeric axes, where categorical series require one categorical (or datetimecontunuous) axis and one numeric axis. However, there is no series that will work with two datetime axes. 

I suppose that if you need to show the Hours in the vertical axes, you can create a new property in your business items - Hours of type double and use this with a LinearAxis.

Regards,
Petar Marchev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ChartView
Asked by
Hila
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or