bony patel
Top achievements
Rank 1
bony patel
asked on 06 Jun 2011, 12:46 PM
Hello All,
I use radchart contron in my application, It's looking nice in UI
But In chart it display all result data and pointmark, But i want only one pointmark display in chart which have maximum value in chart data.
please help me for solution.
.aspx code
radgrid>Series>telerik:ChartSeries>Appearance
<PointMark Corners="Round, Rectangle, Rectangle, Rectangle, 3" Visible="true">
<FillStyle MainColor="Red" SecondColor="Red"></FillStyle>
<Border Color="Red" />
</PointMark>
.cs code
List<UserMaster> _ListUserMaster = _BlueprintReportUserSearchController.GetTimeChartDataLastMonth(DateTime.Now.AddMonths(-1), DateTime.Now.AddDays(-1));
ChartSeries _ChartSeries = RadChart1.Series.GetSeries(0);
_ChartSeries.Appearance.ShowLabels = true;
RadChart1.DataSource = _ListUserMaster;
RadChart1.Series[0].DataYColumn = "TotalUsage";
RadChart1.PlotArea.XAxis.DataLabelsColumn = "XAxisNew";
RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = -90;
RadChart1.DataBind();
I use radchart contron in my application, It's looking nice in UI
But In chart it display all result data and pointmark, But i want only one pointmark display in chart which have maximum value in chart data.
please help me for solution.
.aspx code
radgrid>Series>telerik:ChartSeries>Appearance
<PointMark Corners="Round, Rectangle, Rectangle, Rectangle, 3" Visible="true">
<FillStyle MainColor="Red" SecondColor="Red"></FillStyle>
<Border Color="Red" />
</PointMark>
.cs code
List<UserMaster> _ListUserMaster = _BlueprintReportUserSearchController.GetTimeChartDataLastMonth(DateTime.Now.AddMonths(-1), DateTime.Now.AddDays(-1));
ChartSeries _ChartSeries = RadChart1.Series.GetSeries(0);
_ChartSeries.Appearance.ShowLabels = true;
RadChart1.DataSource = _ListUserMaster;
RadChart1.Series[0].DataYColumn = "TotalUsage";
RadChart1.PlotArea.XAxis.DataLabelsColumn = "XAxisNew";
RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = -90;
RadChart1.DataBind();
8 Answers, 1 is accepted
0
Accepted
Hello bony,
Since there is no way to loop through the PointMarks and turn off the Visibility for some of them what I can suggest is that you turn on the Visibility for all. Then set Width and Height = 0 for all except those with Max Value. The sample code snippet assumes that the last one is with Max Value but you may do the comparison when looping the Items and find your own Maximum.
Best wishes,
Evgenia
the Telerik team
Since there is no way to loop through the PointMarks and turn off the Visibility for some of them what I can suggest is that you turn on the Visibility for all. Then set Width and Height = 0 for all except those with Max Value. The sample code snippet assumes that the last one is with Max Value but you may do the comparison when looping the Items and find your own Maximum.
RadChart1.Series[0].Appearance.PointMark.Visible = true;
RadChart1.Series[0].Appearance.PointMark.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
RadChart1.Series[0].Appearance.PointMark.FillStyle.MainColor = System.Drawing.Color.Red;
for (int i = 0; i < RadChart1.Series[0].Items.Count -1; i++)
{
RadChart1.Series[0].Items[i].PointAppearance.Dimensions.AutoSize = false;
RadChart1.Series[0].Items[i].PointAppearance.Dimensions.Height = 0;
RadChart1.Series[0].Items[i].PointAppearance.Dimensions.Width = 0;
}
Best wishes,
Evgenia
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
bony patel
Top achievements
Rank 1
answered on 10 Jun 2011, 03:07 PM
Hello,
Thank you help, code is running good.
But when chart is display the point mark lable text overwrite on image,ex: in attach file max value 34 can't display properly.
And many time Pointmark text display on chart line also.
please help me for this issue.
Thank you.
Thank you help, code is running good.
But when chart is display the point mark lable text overwrite on image,ex: in attach file max value 34 can't display properly.
And many time Pointmark text display on chart line also.
please help me for this issue.
Thank you.
0
Hello bony,
The "34" Label is positioned over the PointMark as there is no space available above for it to be plotted. What I can suggest is that you extend the YAxis using the AxisMode property:
This way the YAxis MaxValue will be automatically set so that there is enough space for all Chart elements and labels.
Greetings,
Evgenia
the Telerik team
The "34" Label is positioned over the PointMark as there is no space available above for it to be plotted. What I can suggest is that you extend the YAxis using the AxisMode property:
RadChart1.PlotArea.YAxis.AxisMode = Telerik.Charting.ChartYAxisMode.Extended;
Greetings,
Evgenia
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Ram
Top achievements
Rank 1
answered on 14 Jul 2011, 12:27 PM
Hi all
<
telerik:RadChart
ID
=
"dispatcherChart"
runat
=
"server"
Height
=
"160px"
Width
=
"250px"
SeriesOrientation
=
"Horizontal"
>
<
PlotArea
>
<
EmptySeriesMessage
Visible
=
"false"
>
</
EmptySeriesMessage
>
</
PlotArea
>
<
ChartTitle
Visible
=
"false"
>
</
ChartTitle
>
</
telerik:RadChart
>
How to show only ploat area in Radchart without X axis and Y axis Values.
I want to show only bars .
I want to show bars without gaps.
I'm appending the array of values to chart.
as follows(DispatcherCountvalues
is aarylist)
if (DispatcherCountvalues.Count != 0)
{
dispatcherChart.DataSource = DispatcherCountvalues.ToArray();
dispatcherChart.DataBind();
}
I need to show the image as follows. pls help me I'm new to radchart
0
Hi Ram,
You can turn off the Visibility of the Axes like this:
Could you be more specific about that - "I want to show bars without gaps"? You can loop through your array's elements and remove all that have value - 0. Then DataBind the Chart and Bars with YValue = 0 won't be displayed. Does this fit your requirements?
Best wishes,
Evgenia
the Telerik team
You can turn off the Visibility of the Axes like this:
RadChart1.PlotArea.XAxis.Visible = Telerik.Charting.Styles.ChartAxisVisibility.False;
RadChart1.PlotArea.YAxis.Visible = Telerik.Charting.Styles.ChartAxisVisibility.False;
Could you be more specific about that - "I want to show bars without gaps"? You can loop through your array's elements and remove all that have value - 0. Then DataBind the Chart and Bars with YValue = 0 won't be displayed. Does this fit your requirements?
Best wishes,
Evgenia
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
0
Katie Arnott
Top achievements
Rank 1
answered on 03 Feb 2014, 09:12 PM
RadChart1.PlotArea.YAxis.AxisMode = Telerik.Charting.ChartYAxisMode.Extended;
This way the YAxis MaxValue will be automatically set so that there is enough space for all Chart elements and labels.
this works for YAxis MaxValue, but is there a way my YAxisMinValue can get extended to show the full point mark (i.e. plot (0,1) only shows half of my pointmark.
Thanks,
Katie
0
Katie Arnott
Top achievements
Rank 1
answered on 05 Feb 2014, 05:20 PM
Any help out there?
0
Hi Katie,
I am sorry to say that there isn't such a property that controls the MinValue of the y-axis out of the box. What I can suggest is that you set manually an appropriate value for the MinValue.
I can also suggest that you try the newer HtmlChart control that render entirely on the client as SVG and it handles better the layout. For example the rendered markup below looks like this.
ASPX:
More information on the pros and cons of both charts can be found in RadHtmlChart vs. RadChart, round 2. Which one is right for me? blog post. You may also useful Migrating from RadChart to RadHtmlChart
set of articles that sheds more light on how to migrate the basic chart setup from RadChart to RadHtmlChart.
Regards,
Danail Vasilev
Telerik
I am sorry to say that there isn't such a property that controls the MinValue of the y-axis out of the box. What I can suggest is that you set manually an appropriate value for the MinValue.
I can also suggest that you try the newer HtmlChart control that render entirely on the client as SVG and it handles better the layout. For example the rendered markup below looks like this.
ASPX:
RadChart:
<
telerik:RadChart
ID
=
"RadChart1"
runat
=
"server"
Width
=
"600px"
Height
=
"400px"
>
<
Series
>
<
telerik:ChartSeries
Type
=
"Point"
Name
=
"Series 1"
>
<
Items
>
<
telerik:ChartSeriesItem
YValue
=
"0"
XValue
=
"1"
></
telerik:ChartSeriesItem
>
<
telerik:ChartSeriesItem
YValue
=
"1"
XValue
=
"0"
></
telerik:ChartSeriesItem
>
</
Items
>
</
telerik:ChartSeries
>
</
Series
>
<
PlotArea
>
<
YAxis
AxisMode
=
"Extended"
></
YAxis
>
</
PlotArea
>
</
telerik:RadChart
>
RadHtmlChart:
<
telerik:RadHtmlChart
ID
=
"RadHtmlChart1"
runat
=
"server"
Width
=
"600px"
Height
=
"400px"
>
<
PlotArea
>
<
Series
>
<
telerik:ScatterSeries
>
<
SeriesItems
>
<
telerik:ScatterSeriesItem
Y
=
"0"
X
=
"1"
/>
<
telerik:ScatterSeriesItem
Y
=
"1"
X
=
"0"
/>
</
SeriesItems
>
</
telerik:ScatterSeries
>
</
Series
>
</
PlotArea
>
</
telerik:RadHtmlChart
>
More information on the pros and cons of both charts can be found in RadHtmlChart vs. RadChart, round 2. Which one is right for me? blog post. You may also useful Migrating from RadChart to RadHtmlChart
set of articles that sheds more light on how to migrate the basic chart setup from RadChart to RadHtmlChart.
Regards,
Danail Vasilev
Telerik
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 UI for ASP.NET AJAX, subscribe to the blog feed now.