Radchart Point Display in only one max value

Thread is closed for posting
9 posts, 1 answers
  1. bony patel
    bony patel avatar
    5 posts
    Member since:
    Apr 2010

    Posted 06 Jun 2011 Link to this post

    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();
  2. Answer
    Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 09 Jun 2011 Link to this post

    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.

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. bony patel
    bony patel avatar
    5 posts
    Member since:
    Apr 2010

    Posted 10 Jun 2011 Link to this post

    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.
  5. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 14 Jun 2011 Link to this post

    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:
    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.

    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.

  6. Ram
    Ram avatar
    97 posts
    Member since:
    Jun 2011

    Posted 14 Jul 2011 Link to this post

    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
  7. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 19 Jul 2011 Link to this post

    Hi Ram,

    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!

  8. Katie Arnott
    Katie Arnott avatar
    25 posts
    Member since:
    Dec 2009

    Posted 03 Feb 2014 Link to this post

    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
  9. Katie Arnott
    Katie Arnott avatar
    25 posts
    Member since:
    Dec 2009

    Posted 05 Feb 2014 Link to this post

    Any help out there?
  10. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 06 Feb 2014 Link to this post

    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:
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017