Sparkline style

4 posts, 1 answers
  1. Dan
    Dan avatar
    11 posts
    Member since:
    Mar 2009

    Posted 10 Feb 2010 Link to this post

    Hello,
    I recently read the excellent  book "Next-Generation Business Intelligence Software with Silverlight 3"

    http://www.amazon.com/Next-Generation-Business-Intelligence-Software-Silverlight/dp/1430224878

    I am trying to incorporate some of things i learned into my existing application.  Much of the sample code was against Silverlight Toolkit and not Telerik charts.  I am trying to port some of the styles from toolkit to telerik.  I have figured out many of them but not all. 

    Basically the chart is a word sized, sparkline that contains 2 line series.  I am hoping someone can share the xaml for:

    1.  Set the StrokeThickness, Opacity and StrokeDashArray of a line series definition
    2.  Turn off showing datapoints.
    3.   For x axis, set the height and opacity.
    4.  for the Y axis, set opacity, min, max.
    5.  have the chart background be equal to whatever container it is in.  In my case, the chart is within a cell within a datagrid.

    Below my signature, i have pasted the Silverlight Toolkit xaml for the styles.

    Dan

                  
                <!--Hide the border edges-->
                <chartingToolkit:Chart.Template>
                    <ControlTemplate TargetType="chartingToolkit:Chart">
                        <chartingPrimitivesToolkit:EdgePanel x:Name="ChartArea">
                            <Grid Canvas.ZIndex="-1"></Grid>
                        </chartingPrimitivesToolkit:EdgePanel>
                    </ControlTemplate>
                </chartingToolkit:Chart.Template>
                <!--Format the axes for a sparkline-->
                <chartingToolkit:Chart.Axes>
                    <chartingToolkit:DateTimeAxis Orientation="X" MaxHeight="1" Opacity="0"/>
                    <chartingToolkit:LinearAxis Orientation="Y" Opacity="1" Minimum="0" Maximum="10"/>
                </chartingToolkit:Chart.Axes>

     

     

      <!--DataPointStyle-->
                    <chartingToolkit:LineSeries.DataPointStyle>
                        <Style TargetType="Control">
                            <!---->
                            <Setter Property="Visibility" Value="Collapsed"/>
                            <!---->
                            <Setter Property="Background" Value="Black"/>
                        </Style>
                    </chartingToolkit:LineSeries.DataPointStyle>

                    <!--use dashes for reference line-->
                    <chartingToolkit:LineSeries.PolylineStyle>
                        <Style TargetType="Polyline">
                            <!---->
                            <Setter Property="Opacity" Value="0.75"/>
                            <!---->
                            <Setter Property="StrokeDashArray" Value="2"/>
                            <!---->
                            <Setter Property="StrokeThickness" Value="0.75"/>
                        </Style>
                    </chartingToolkit:LineSeries.PolylineStyle>

                    <!--DataPointStyle-->
                    <chartingToolkit:LineSeries.DataPointStyle>
                        <Style TargetType="Control">
                            <!---->
                            <Setter Property="Visibility" Value="Collapsed"/>
                            <!---->
                            <Setter Property="Background" Value="Black"/>
                        </Style>
                    </chartingToolkit:LineSeries.DataPointStyle>

                    <!--use dashes for reference line-->
                    <chartingToolkit:LineSeries.PolylineStyle>
                        <Style TargetType="Polyline">
                            <!---->
                            <Setter Property="StrokeThickness" Value="0.75"/>
                        </Style>
                    </chartingToolkit:LineSeries.PolylineStyle>





  2. Answer
    Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 16 Feb 2010 Link to this post

    Hello Dan,

    This help topic might just help for most of the questions.

    Best wishes,
    Vladimir Milev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Dan
    Dan avatar
    11 posts
    Member since:
    Mar 2009

    Posted 16 Feb 2010 Link to this post

    Thanks!
    Dan
  4. Carlos Serrano
    Carlos Serrano avatar
    3 posts
    Member since:
    Feb 2010

    Posted 12 Apr 2010 Link to this post

    Dan,

    I am looking for exactly the same information.
    I guess the low level steps described in the documentation pointed out by the Telerik team are enough... though I have not done it yet. Have you been able to get an equivalent configuration to the one described in the "BI with SL3" book?

    Thanks!
    Carlos
Back to Top