TimeBar with StackedBar

4 posts, 1 answers
  1. Евгений
    Евгений avatar
    2 posts
    Member since:
    Sep 2011

    Posted 19 Oct 2011 Link to this post

    can you provide example how can i put into timeBar StackedBar, beacuse this class doesn't have similar properties like RadAreaSparkline 

    my code is 

    <telerik:RadTimeBar Height="150" VerticalAlignment="Top" Margin="6"
                        PeriodStart="1-Jan-2010" PeriodEnd="1-Jan-2012"
                        VisiblePeriodStart="11-Nov-2010" VisiblePeriodEnd="15-Mar-2011"
                        SelectionStart="03-Jan-2011" SelectionEnd="17-Jan-2011">
        <telerik:RadTimeBar.Intervals>
            <telerik:YearInterval />
            <telerik:MonthInterval />
        </telerik:RadTimeBar.Intervals>
     
        <Grid>
            <telerik:RadAreaSparkline Margin="0,3" ItemsSource="{Binding LinearData}" XValuePath="Date" YValuePath="Value" />
            <telerik:StackedArea Margin="0,3" ItemsSource="{Binding ColumnData}" XValuePath="Date" YValuePath="Value" ItemFill="{StaticResource StrongBrush}" />
        </Grid>
    </telerik:RadTimeBar>

    but it has an error
  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 24 Oct 2011 Link to this post

    Hi Evgeny,
    Basically, there are no restrictions to what control you can add as content for the timeBar control. However, I am not quite sure I understand what you are trying to do and that is why, I cannot give you more precise information on a possible solution to your problem. You mention StackedBar but you have added a StackedArea as content of the timeBar. Basically, you should not be able to run the code that you have posted - the StackedArea is part of the chart control and you cannot use it as a stand-alone control. Have a look at the following online examples:

    That is why, in case you want to use the StackedArea or StackedBar, you will have to use a chart control.

    On the other hand, you can use the column sparkline, in case it is applicable in your scenario - http://demos.telerik.com/silverlight/#Sparklines/Gallery.

    In case you need additional help with that, please explain in detail what you are trying to achieve and which control you have decided to use.

    Kind regards,
    Tsvetie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Евгений
    Евгений avatar
    2 posts
    Member since:
    Sep 2011

    Posted 24 Oct 2011 Link to this post

    hi, 

    i want that timeBar will contains one sparkline and two columnSparklines with different colors, how i can do it?

    maybe one sparkline and one columnsparkline with custom theming?
  5. Answer
    Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 28 Oct 2011 Link to this post

    Hi Evgeny,
    You can specify the color for the column sprklines using the ItemFill property. For example:
    <telerik:RadTimeBar x:Name="RadTimeBar1" PeriodStart="2011-01-01" PeriodEnd="2011-03-03">
        <telerik:RadTimeBar.Intervals>
            <telerik:DayInterval />
            <telerik:WeekInterval />
            <telerik:MonthInterval />
        </telerik:RadTimeBar.Intervals>
        <Grid>
            <telerik:RadColumnSparkline ItemFill="Green" ItemsSource="{Binding Data, ElementName=viewModel}" XValuePath="TimeStamp" YValuePath="Data" />
            <telerik:RadColumnSparkline ItemFill="Blue" ItemsSource="{Binding Data2, ElementName=viewModel}" XValuePath="TimeStamp" YValuePath="Data" />
            <telerik:RadLinearSparkline LineStroke="Red" ItemsSource="{Binding Data3, ElementName=viewModel}" XValuePath="TimeStamp" YValuePath="Data" />
        </Grid>
    </telerik:RadTimeBar>

    Regards,
    Tsvetie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top