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

TimeBar with StackedBar

3 Answers 83 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Евгений
Top achievements
Rank 1
Евгений asked on 19 Oct 2011, 01:58 PM
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

3 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 24 Oct 2011, 01:38 PM
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 >>

0
Евгений
Top achievements
Rank 1
answered on 24 Oct 2011, 06:03 PM
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?
0
Accepted
Tsvetie
Telerik team
answered on 28 Oct 2011, 08:19 AM
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 >>

Tags
TimeBar
Asked by
Евгений
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Евгений
Top achievements
Rank 1
Share this question
or