Circle in line chart

Thread is closed for posting
4 posts, 1 answers
  1. Paulo
    Paulo avatar
    56 posts
    Member since:
    Apr 2012

    Posted 18 May 2012 Link to this post

    I have a line series chart. How can I do to show a circle into line value:

    ------------18--------
    A circle around 18 and so on. If my graph has more value, the circle must be in each value.
  2. Answer
    Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 23 May 2012 Link to this post

    Hello Paulo, 

    In order to make the Series's labels circles you have to do 2 things:
    1. Set each of your ChartSeries's Appearance.LabelAppearance.FillStyle.MainColor properties to a specific value
      • by default this property is set to null, so labels can't be drawn when their colour is unknown
    2. Set each of yours ChartSeries's Appearance.LabelAppearance.Figure to Circle
      • by default it is Rectangle
    Or declaratively in your .aspx file:
    <telerik:RadChart ID="RadChart1" runat="server" Height="450px" Width="600px">
        <Series>
            <telerik:ChartSeries Name="Series 1" Type="Line">
                <Appearance>
                    <FillStyle MainColor="213, 247, 255" />
                    <LabelAppearance Figure="Circle">
                        <FillStyle MainColor="Azure" /> //or any other color
                    </LabelAppearance>
                </Appearance>
                <Items>
                    <telerik:ChartSeriesItem Name="Item 1" XValue="0" YValue="3" />
                    //...
                </Items>
            </telerik:ChartSeries>
            //<telerik:ChartSeries Name="Series ...X" Type="Line">
            //  Appearance>
            //      <FillStyle MainColor="213, 247, 255" />
            //      <LabelAppearance Figure="Circle">
            //          <FillStyle MainColor=/*your colour for Series X here*/"" />
            //      </LabelAppearance>
            //  </Appearance>
            //  //...
            //</telerik:ChartSeries>
             
        </Series>
    </telerik:RadChart>

    You can explore the different properties of Line series from Visual Studio by:
    1. right-clicking in the design view on a RadChart control ->
    2. Click Properties ->
    3. The properties pane will appear in VS (if it's not already there)
    4. Go to Series click on the button [...], right-side of (Collection)
    5. The ChartSeries Collection Editor Window will pop-up
    6. Explore the properties of Each of your Series (the properties set there will apply to all of the series's items, unless you change something on a specific item)
    I hope my answer is helpful. 

    All the best,
    Petar Kirov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paulo
    Paulo avatar
    56 posts
    Member since:
    Apr 2012

    Posted 23 May 2012 Link to this post

    I try:
    chartSeries5.Appearance.FillStyle.. but LabelAppearance is not posible. How can I do with codebehind?
    I have a dificult to change of aspx to codebehind. I use codebehind..
    This way do not work too.
    chartSeries5.Appearance.LabelAppearance.FillStyle.... no is posible too. 

    I made:
    chartSeries5.Appearance.LabelAppearance.Figure = Telerik.Charting.Styles.DefaultFigures.Circle; Do not work too.
  5. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 28 May 2012 Link to this post

    Hi Paulo,

    If you want to add chartSeries in code behind you can try this:
    1. Create a ChartSeries object:
    ChartSeries chartSeries1 = new ChartSeries();
    2. Set its type to whatever you like:
    chartSeries1.Type = ChartSeriesType.Line; // For example
    3. Change its Appearance.LabelAppearance.Figure to "Circle" and set MainColor to something different than null:
    chartSeries1.Appearance.LabelAppearance.Figure = "Circle";
    chartSeries1.Appearance.LabelAppearance.FillStyle.MainColor = System.Drawing.Color.DarkBlue;
    4. Set its items:
    chartSeries1.SetItems(
        new ChartSeriesItem(1, 6),
        new ChartSeriesItem(0, 3)
        //... or something like that depending on your data source
        );
    5. Finally don't forget to add it to your RadChart:
    radChart1.AddChartSeries(chartSeries1);

    All the best,
    Petar Kirov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top