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

Circle in line chart

3 Answers 55 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Paulo
Top achievements
Rank 1
Paulo asked on 18 May 2012, 03:05 PM
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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Petar Kirov
Telerik team
answered on 23 May 2012, 01:12 PM
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.
0
Paulo
Top achievements
Rank 1
answered on 23 May 2012, 01:29 PM
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.
0
Petar Kirov
Telerik team
answered on 28 May 2012, 11:02 AM
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.
Tags
Chart (Obsolete)
Asked by
Paulo
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Paulo
Top achievements
Rank 1
Share this question
or