LoadFromXml width & height not working

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    27 posts
    Member since:
    Nov 2008

    Posted 27 May 2009 Link to this post

     

     

    I'm attempting to load default chart settings from an xml file like this:-

    RadChart chart = new RadChart();
    chart.LoadFromXml (filename)
     
    But the default size of chart (400px x 300px) seems to get used despite the fact that my xml starts like this :-

    <RadChart Location="0, 0" Size="300, 200" TabIndex="0">

    Why is this? Is it a bug? Are there any other items that cannot be set from the xml file?

    Andrew

  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 29 May 2009 Link to this post

    Hi Andrew,

    I cannot reproduce the issue. Here is my code (I am sending only the code-behind, as the application contains no other controls):
    namespace WindowsFormsApplication1 
        public partial class Form1 : Form 
        { 
            public Form1() 
            { 
                InitializeComponent(); 
     
                RadChart chart = new RadChart(); 
                chart.LoadFromXml("chart.xml"); 
                this.Controls.Add(chart); 
            } 
        } 

    And here is the XML file:
    <RadChart DefaultType="Pie" Location="0, 0" Size="120, 100" TabIndex="0"
      <Series> 
        <ChartSeries Type="Pie" Name="Series 1"
          <Items> 
            <ChartSeriesItem YValue="10" Name="Item 1" /> 
            <ChartSeriesItem YValue="20" Name="Item 2" /> 
            <ChartSeriesItem YValue="17" Name="Item 3" /> 
            <ChartSeriesItem YValue="30" Name="Item 4" /> 
          </Items> 
        </ChartSeries> 
      </Series> 
      <PlotArea> 
        <XAxis MinValue="1" MaxValue="4" /> 
      </PlotArea> 
    </RadChart> 

    Can you, please, provide a sample project that we can analyze? In order to do that, you need to open a Support ticket (not forum) or I can move the current thread in the Support area if that will be easier for you.

    All the best,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top