Spline chart end caps.

Thread is closed for posting
4 posts, 0 answers
  1. Todd Hile-Hoffer
    Todd Hile-Hoffer avatar
    19 posts
    Member since:
    Dec 2008

    Posted 14 Sep 2009 Link to this post

    I have a radchart with a default type of spline. The issue is that user can't tell the beginning and end of the line. I have tried all the different end caps but because they are the same color they just are not obvious.

    I couldn't figure out how to use the custom endCap or StartCap and I am looking for a solution or alternative such as plotting two points.

  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 17 Sep 2009 Link to this post

    Hi Todd Hile-Hoffer,

    Unfortunately, the caps cannot be customized at the moment. A possible workaround would be to use the pointmarks, showing only the first and the last one. Here is an example:

     <telerik:RadChart ID="RadChart1" runat="server"
                <Series> 
                    <telerik:ChartSeries Name="Series 1" Type="Spline" YAxisType="Primary"
                        <Appearance> 
                            <PointMark Visible="true"
                            </PointMark> 
                        </Appearance> 
                        <Items> 
                            <telerik:ChartSeriesItem Name="Item 1" YValue="3"
                                <PointAppearance Figure="Cross" Visible="True"
                                    <FillStyle FillType="Solid" MainColor="Red" SecondColor="Red"
                                    </FillStyle> 
                                </PointAppearance> 
                            </telerik:ChartSeriesItem> 
                            <telerik:ChartSeriesItem Name="Item 2" YValue="3"
                            </telerik:ChartSeriesItem> 
                            <telerik:ChartSeriesItem Name="Item 3" YValue="4"
                            </telerik:ChartSeriesItem> 
                            <telerik:ChartSeriesItem Name="Item 4" YValue="2"
                                <PointAppearance Figure="Figure1" Visible="True"
                                    <FillStyle FillType="Solid" MainColor="Green"
                                    </FillStyle> 
                                </PointAppearance> 
                            </telerik:ChartSeriesItem> 
                        </Items> 
                    </telerik:ChartSeries> 
                </Series> 
                <CustomFigures> 
                    <telerik:CustomFigure Description="20,20,273,211:19,19,False,0,0,0,0,0:293,20,False,0,0,0,0,0:159,127,False,0,0,0,0,0:20,231,False,0,0,0,0,0:" 
                        Name="Figure1" /> 
                </CustomFigures> 
            </telerik:RadChart> 


    All the best,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Todd Hile-Hoffer
    Todd Hile-Hoffer avatar
    19 posts
    Member since:
    Dec 2008

    Posted 17 Sep 2009 Link to this post

    Thanks for the help, btw. I tried to add the following code but no point appeared. Am I missing something?
      SessionItems.endTime = (DateTime)this.RadDateTimePicker1.DbSelectedDate;  
            DataTable dt = Data.HistoricalLeakWarn_3M(SessionItems.endTime);  
            this.RadChart3M.DataSource = dt;  
            this.RadChart3M.DataBind();  
            Telerik.Charting.ChartSeriesItem startPoint = new Telerik.Charting.ChartSeriesItem();  
            startPoint.XValue = double.Parse(dt.Rows[0][0].ToString());  
            startPoint.YValue = double.Parse(dt.Rows[0][1].ToString());  
     
            startPoint.PointAppearance.Figure = "Cross";  
            startPoint.PointAppearance.Visible = true;  
            startPoint.PointAppearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;  
            startPoint.PointAppearance.FillStyle.MainColor = System.Drawing.Color.Green;  
            startPoint.PointAppearance.FillStyle.SecondColor = System.Drawing.Color.Green;  
            this.RadChart3M.Series[0].Items.Add(startPoint); 
  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 22 Sep 2009 Link to this post

    Hi Todd,

    After the call to DataBind method the chart series and items are created, so you would not need to create new ones - just retrieve the existing series and items and modify them:

    RadChart1.DataBind(); 
            ChartSeries series = RadChart1.Series[0]; 
            series.Appearance.PointMark.Visible = true
            series.Type = ChartSeriesType.Spline; 
     
            ChartSeriesItem startPoint = series[0]; 
            startPoint.PointAppearance.Figure = "Cross"
            startPoint.PointAppearance.Visible = true
            startPoint.PointAppearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid; 
            startPoint.PointAppearance.FillStyle.MainColor = System.Drawing.Color.Green; 
            startPoint.PointAppearance.FillStyle.SecondColor = System.Drawing.Color.Green;   

    Hope this helps.

    All the best,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top