Axis Labels don't show on save method

Thread is closed for posting
6 posts, 0 answers
  1. Abraham
    Abraham avatar
    5 posts
    Member since:
    Dec 2010

    Posted 06 May 2011 Link to this post

    I am trying to save a radchart to a MemoryStream and then save it within a generated pdf. The chart is successfully saved as an image in the pdf, however the axis labels do not show. Is there a property I need to set for the axis labels that I am not aware of? Thank you

  2. Abraham
    Abraham avatar
    5 posts
    Member since:
    Dec 2010

    Posted 09 May 2011 Link to this post

    It also does not work as just a regular save file. Please see attached code:

    <telerik:RadChart ID="radChart1" runat="server" Height="876px" Width="876px" AutoLayout="true"
                                        AutoTextWrap="true" Skin="Hay" Visible="false">
                                        <ClientSettings ScrollMode="Both" />
                                        <ChartTitle TextBlock-Text="Test" TextBlock-Appearance-TextProperties-Color="Black">
                                        <Legend Appearance-Position-AlignedPosition="Center" Appearance-Overflow="Row" Visible="true">
                                            <Appearance Position-Auto="true" ItemAppearance-Visible="true">
                                            <XAxis AxisLabel-TextBlock-Text="Date and Time" AxisLabel-Visible="true">
                                                <AxisLabel Visible="true" TextBlock-Visible="true">
                                            <YAxis AxisLabel-TextBlock-Text="Units" AxisLabel-Visible="true">
                                                <AxisLabel Visible="true" TextBlock-Visible="true">

    And for the code behind I'm just doing a simple save

    radChart1.Save("C:\\projects\\test.png", System.Drawing.Imaging.ImageFormat.Png);

    As I said before, the chart and legend is saving to the image but the axis labels are not. Thank you
  3. DevCraft R3 2016 release webinar banner
  4. Abraham
    Abraham avatar
    5 posts
    Member since:
    Dec 2010

    Posted 10 May 2011 Link to this post

    I have found the issue and have come up with a solution. Having ScrollMode in the client setting section of my chart set to "Both" was causing the image produced by the save method to return an image without the x and y axis nor axis labels. In my code behind, setting ScrollMode to "None" before saving saving the chart as an image, and then resetting the ScrollMode to "Both" solved this issue. Maybe this is something telerik can look at as a bug fix in the future. Thank you
  5. Evgenia
    Evgenia avatar
    1396 posts

    Posted 11 May 2011 Link to this post

    Hi Abraham,

    Thanks for sharing your resolution of the issue with us. Your feedback was forwarded to our developers.
    You may find your Telerik points updated.

    All the best,
    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. Alexander
    Alexander avatar
    1 posts
    Member since:
    Feb 2012

    Posted 11 Feb 2012 Link to this post

    I've faced the same issue. But I can't use the provided solution, because I have too many labels. When I'm using "None" scroll value,  the labels and the diagram appears too tight at the image. Please let me know if there is any solution of this problem.
  7. Evgenia
    Evgenia avatar
    1396 posts

    Posted 15 Feb 2012 Link to this post

    Hello Alexander,

    I am afraid saving/exporting has not been designed to work with zoomed chart, hence the result you observe. I am sorry to say it, there is no applicable workaround at the moment that would allow you to export only the visible part of the graph. You can export the entire chart as you already do with "Save shrink image" button, but set larger dimensions before exporting it. This way labels will look nice and when viewing the image in smaller container the entire image will shrink, so the labels will not overlap:

    protected void OnBtn_Click2(object sender, EventArgs e)
                Unit width = RadChart1.Width;
                Unit height = RadChart1.Height;
                RadChart1.ClientSettings.ScrollMode = Telerik.Web.UI.ChartClientScrollMode.None;
                RadChart1.Width = Unit.Pixel(1600);
                RadChart1.Height = Unit.Pixel(1200);
                RadChart1.Save("C://ChatrtShrinkImage.png", ImageFormat.Png);
                RadChart1.Width = width;
                RadChart1.Height = height;
                RadChart1.ClientSettings.ScrollMode = Telerik.Web.UI.ChartClientScrollMode.Both;

    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top
DevCraft R3 2016 release webinar banner