Multiple RadLinearSparkline and performance?

4 posts, 0 answers
  1. Yonghan
    Yonghan avatar
    27 posts
    Member since:
    Dec 2010

    Posted 19 Jul 2012 Link to this post

    Hi,
    I got a serious problem when I using TimeBar with multiple RadLinearSparklines.
    data points = 3 x 24 x 60 = 4320.
    the movement is too slow.

    What's the best way to use TimeBar with multiple lines?


    <
    Window x:Class="WpfApplication4.MainWindow"
            xmlns:example="clr-namespace:WpfApplication4"
            Title="MainWindow" Height="350" Width="1024">
        <Window.DataContext>
            <example:ExampleViewModel StartDate="2012-01-01 00:00:00" EndDate="2012-01-04 00:00:00" />
        </Window.DataContext>
        <Grid x:Name="LayoutRoot" Background="White">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="AUto"/>
            </Grid.RowDefinitions>
            <telerik:RadTimeBar Margin="6" VerticalAlignment="Top"  telerik:StyleManager.Theme="Metro"
                                PeriodStart="2012-01-01 00:00:00"         PeriodEnd="2012-01-04 00:00:00"
                                VisiblePeriodStart="2012-01-01 00:00:00" VisiblePeriodEnd="2012-01-01 06:00:00"
                                SelectionStart="2012-01-01 02:00:00"     SelectionEnd="2012-01-01 03:00:00"
                                MinSelectionRange="00:01:00"
                                IsSnapToIntervalEnabled="False"
                                FontSize="9"
                                SelectionTitleFormatString="{}{0:yyyy'-'MM'-'dd HH':'mm':'ss} - {1:yyyy'-'MM'-'dd HH':'mm':'ss}">
                <telerik:RadTimeBar.Intervals>
                    <telerik:DayInterval />
                    <telerik:HourInterval  IntervalSpans="1,6,12,20" />
                    <telerik:MinuteInterval IntervalSpans="1,10,15,30" />
                </telerik:RadTimeBar.Intervals>
                <StackPanel>
                    <telerik:RadLinearSparkline ItemsSource="{Binding LinearData}" XValuePath="Date" YValuePath="Value" Height="40" Margin="0 8" LineStroke="Red" />
                    <Border Height="1" Background="LightGray"/>
                    <telerik:RadLinearSparkline ItemsSource="{Binding LinearData2}" XValuePath="Date" YValuePath="Value" Height="40" Margin="0 8" LineStroke="Blue" />
                    <Border Height="1" Background="LightGray"/>
                    <telerik:RadLinearSparkline ItemsSource="{Binding LinearData}" XValuePath="Date" YValuePath="Value" Height="40" Margin="0 8" LineStroke="Green" />
                    <Border Height="1" Background="LightGray"/>
                    <telerik:RadLinearSparkline ItemsSource="{Binding LinearData2}" XValuePath="Date" YValuePath="Value" Height="40" Margin="0 8"  LineStroke="Cyan" />
                    <Border Height="1" Background="LightGray"/>
                    <telerik:RadLinearSparkline ItemsSource="{Binding LinearData}" XValuePath="Date" YValuePath="Value" Height="40" Margin="0 8" LineStroke="Brown" />
                    <Border Height="1" Background="LightGray"/>
                    <telerik:RadLinearSparkline ItemsSource="{Binding LinearData2}" XValuePath="Date" YValuePath="Value" Height="40" Margin="0 8" LineStroke="Magenta"/>
                    <Border Height="1" Background="LightGray"/>
                </StackPanel>
            </telerik:RadTimeBar>
        </Grid>
    </Window>



  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 19 Jul 2012 Link to this post

    Hi Yonghan,

    Unfortunately, the only thing that I can suggest in this case, besides using the latest version of the controls, in case you are not, is to reduce the number of items in the sparkline controls. For example, you can use some custom logic to filter the data.

    Kind regards,
    Tsvetie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Yonghan
    Yonghan avatar
    27 posts
    Member since:
    Dec 2010

    Posted 20 Jul 2012 Link to this post

    thank you.
    But I have no idea for about custom data filtering.
    Can you post a data filter example?

    Thanks
  5. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 20 Jul 2012 Link to this post

    Hello Yonghan,

    What I meant by "custom logic to filter the data" was that, depending on your scenario, specific data and specification, you can reduce the data before you pass it to the sparkline. In case the sparkline controls have less points to show, the performance will be better.

    Greetings,
    Tsvetie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top