Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
unable to launch sample with xml data in visual studio
posted

The sample looks well in Expression Blend, but it's not possible to see any charts after it was compiled with Visual Studio. 

Maybe there is a problem with the data binding path.

 

Does anyone has an idea? 

Parents
  • 739
    posted

    Hi,

    The reason could be xml file location. Please try to use absolute path of the xml file. This sample shows how to use data binding with xml source. It is created in Expression Blend and after that used in Visual Studio where data appears on the chart:

     

    XML data source:

    <?xml version="1.0" encoding="UTF-8"?>
    <dataroot>
    <Table1>
    <ID>1</ID>
    <Name>John</Name>
    <Price>53</Price>
    </Table1>
    <Table1>
    <ID>2</ID>
    <Name>Ed</Name>
    <Price>68</Price>
    </Table1>
    <Table1>
    <ID>3</ID>
    <Name>David</Name>
    <Price>29</Price>
    </Table1>
    </dataroot>

     

    xaml:

    <Window.Resources>
     <XmlDataProvider x:Key="PatientData" Source="C:\TFS\Table1.xml" />
    </Window.Resources>

    <igCA:XamChart x:Name="Chart1">
     <igCA:XamChart.Series>
      <igCA:Series Label="Patient Height" ChartType="Column" DataSource="{Binding Mode=Default, Source={StaticResource PatientData}, XPath=/dataroot}" DataMapping="Value=Price; Label=Name" />
      </igCA:XamChart.Series>
    </igCA:XamChart>

    Thanks,
    GoranS


     

Reply Children