Here is my code.
ChartSeries s = RadChart2.GetSeries(0);
s.Appearance.ShowLabels = false;
s.Appearance.PointMark.Dimensions.AutoSize = false;
s.Appearance.PointMark.FillStyle.MainColor = Color.Red;
s.Appearance.PointMark.FillStyle.SecondColor = Color.White;
s.Appearance.PointMark.Dimensions.Height = 2;
s.Appearance.PointMark.Dimensions.Width = 2;
s.Appearance.PointMark.Visible = true;
s.Appearance.PointDimentions.Height = 2;
s.Appearance.PointDimentions.Width = 2;
s.Appearance.PointDimentions.AutoSize = false;
s.Appearance.FillStyle.MainColor = Color.Red;
s.Appearance.FillStyle.SecondColor = Color.White;
s.Appearance.PointShape = "Diamond";
s.Appearance.PointMark.Figure = "Diamond";
As you can see, I am setting everything I can think of to see if it will work.
Any help would be greatly appreciated.
BTW, why would you ask us to set the figure property as string?
What happened to enum?
Thanks.
- MK
5 Answers, 1 is accepted
If you are trying to change the color only for the point marks (Line chart), it could be done like this:
s.Appearance.ShowLabels = false; |
s.Appearance.PointMark.Dimensions.AutoSize = false; |
s.Appearance.PointMark.FillStyle.MainColor = Color.Red; |
s.Appearance.PointMark.FillStyle.SecondColor = Color.White; |
s.Appearance.PointMark.Dimensions.Height = 10; |
s.Appearance.PointMark.Dimensions.Width = 10; |
s.Appearance.PointMark.Visible = true; |
s.Appearance.PointMark.FillStyle.MainColor = Color.Red; |
s.Appearance.PointMark.FillStyle.SecondColor = Color.White; |
s.Appearance.PointMark.Figure = Telerik.Charting.Styles.DefaultFigures.Diamond; |
If you are trying to change the color for the points in a Point chart, it could be achieved like this:
s.Appearance.PointShape = Telerik.Charting.Styles.DefaultFigures.Diamond; |
s.Appearance.FillStyle.MainColor = Color.Red; |
s.Appearance.FillStyle.SecondColor = Color.White; |
s.Appearance.PointDimentions.Height = 10; |
s.Appearance.PointDimentions.Width = 10; |
s.Appearance.PointDimentions.AutoSize = false; |
As for the enum -- it is still present (Telerik.Charting.Styles.DefaultFigures) but there is option to set the property as plain string in order to provide support for custom user-defined figures.
All the best,
Manuel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

I want to change properties of the points in a point chart.
I followed your 2nd option but I am still getting the same default color points (blue). It changed the shape to "+" even though I am setting it to "Diamond".
BTW, it changed the legend to red and white but not the actual points on the point chart.
Here is my code example
SqlCommand cmd = new SqlCommand("SELECT FLOW FROM FLOW_MONITORING WHERE FLOW_MONITOR_ID = 2 AND TIMESTAMP >= '03/20/2008' AND TIMESTAMP <= '03/30/2008'", conn);
SqlDataReader rd = cmd.ExecuteReader();
RadChart2.DataSource = rd;
RadChart2.DataBind();
ChartSeries
s = RadChart2.GetSeries(0);
s.Appearance.ShowLabels = false;
s.Appearance.PointShape = Telerik.Charting.Styles.DefaultFigures.Diamond;
s.Appearance.FillStyle.MainColor = Color.Red;
s.Appearance.FillStyle.SecondColor = Color.White;
s.Appearance.PointDimentions.Height = 2;
s.Appearance.PointDimentions.Width = 2;
s.Appearance.PointDimentions.AutoSize = false;
Thanks again for your help.
-MK
If your point size is very small, you might need to turn off the border in order to see the color applied like this: s.Appearance.Border.Visible = false;
Attached is a runnable sample application as well.
Regards,
Manuel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can achieve the desired effect like this:
ASPX
<
telerik:RadChart
ID
=
"RadChart1"
runat
=
"Server"
AutoLayout
=
"true"
AutoTextWrap
=
"true"
>
<
Series
>
<
telerik:ChartSeries
Type
=
"Point"
Name
=
"National Average"
>
<
Appearance
PointShape
=
"Triangle"
/>
<
Items
>
<
telerik:ChartSeriesItem
YValue
=
"21"
/>
<
telerik:ChartSeriesItem
YValue
=
"11"
/>
<
telerik:ChartSeriesItem
YValue
=
"15"
/>
</
Items
>
</
telerik:ChartSeries
>
<
telerik:ChartSeries
Type
=
"Point"
Name
=
"National Average 2"
>
<
Items
>
<
telerik:ChartSeriesItem
YValue
=
"31"
/>
<
telerik:ChartSeriesItem
YValue
=
"41"
/>
<
telerik:ChartSeriesItem
YValue
=
"55"
/>
</
Items
>
</
telerik:ChartSeries
>
</
Series
>
</
telerik:RadChart
>
C#
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadChart1.BeforeLayout +=
new
EventHandler<EventArgs>(RadChart1_BeforeLayout);
}
void
RadChart1_BeforeLayout(
object
sender, EventArgs e)
{
RadChart1.Legend.Items[0].Marker.Appearance.Figure = DefaultFigures.Triangle;
}
Greetings,
Freddie
the Telerik team