Subscribe RSS Join our Facebook Group Follow us on Twitter!
in Search

Izzuddin Gumilar's Blog

June 2011 - Posts

  • Using Chart Control for Windows Phone 7

    In this post, I'll show you how to use chart component in windows phone 7 application. I use third party library amChart, it has a free version and we can use it for create chart in wpf, silverlight, or windows phone 7. You can download the library from http://wpf.amcharts.com/download and choose amCharts Quick Charts for Windows Phone 7 (Silverlight) if you want to build windows phone 7 apps.

    Add AmCharts.Windows.QuickCharts.WP.dll library into your project.


    After that, on MainPage.xaml add this code below into your page.

    <amq:SerialChart x:Name="chart1" DataSource="{Binding Data}" CategoryValueMemberPath="axis"
     AxisForeground="White"
     PlotAreaBackground="Black"
     GridStroke="DarkGray">
     <amq:SerialChart.Graphs>
     <amq:ColumnGraph ValueMemberPath="value" Title="Column #2" Brush="#8000FF00" ColumnWidthAllocation="0.4" />
     </amq:SerialChart.Graphs>
     </amq:SerialChart>

    Don't forget add this assembly reference declaration before :

    xmlns:amq="clr-namespace:AmCharts.Windows.QuickCharts;assembly=AmCharts.Windows.QuickCharts.WP"
    

    There are many types of serial or pie chart that you can use, in code example above amq:ColumnGraph represnt a column bar chart, you can use amq:LineGraph and amq:AreaGraph for line and area chart type. Now, let's fill your chart value from code behind..

    Create a new class name it ItemData which have two properties, axis and value. Axis is the name of column field and value property is the value of it column field.

    public class ItemData
     {
     public string axis { get; set; }
     public double value { get; set; }
     }

    And then, define ItemData collection in MainPage class and give value of each properties.

    private ObservableCollection<ItemData> _data = new ObservableCollection<ItemData>()
     {
     new ItemData() { axis = "Jan", value=5},
     new ItemData() { axis = "Feb", value=15.2},
     new ItemData() { axis = "Mar", value=7},
     new ItemData() { axis = "Apr", value=10}
     };

    Finally, create OnLoad event handler from MainPage.xaml for set DataContext to refer MainPage class.

     

    private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
     {
     this.DataContext = this;
     }

    This is the screenshot this example tutorial :

     

    And you can download this source code.

     

    1,842 Views, 0 Comment(s), Published on: 06-03-2011 5:06 by izzuddin to Izzuddin Gumilar's Blog
    | More
    Filed under: , ,
  • Consume WCF Service from BizTalk Orchestration

    Sometimes when we orchestrate our services, we need invoke or consume our services whether it is WCF or web service. Before a service can be used, it must be generated into schema file from service metadata so it can use for configure port object in BizTalk. Ok, I'll show you how to generate wcf service into BizTalk orchestration project. I assume that you have create a biztalk orchestration project before. In this tutorial, I use Microsoft Biz Talk Server 2010 and Visual Studio 2010 as IDE.

    First, right click from your BizTalk orchestration and select Add -> Add Generated Items


    And then select Consume WCF Service. It uses for generate schema from wsdl address if you use WCF or web service. If you have another format input, you can choose other menus. 

     

    After that, It will open WCF Service Consuming wizard. Choose Metadata Exchange (MEX) end point as metadata source for get wsdl address schema from running service or if you have wsdl file schema you can choose metadata files.


    Input your wsdl service address and click get button. It will get the wsdl schema from your service and then click next button.


    Input the namespace of your generated schema and then click import button. It will generate automatically your schema file for orchestration port type usage.

    Thanks for reading.. :)

    Related Blog Post : Orchestration of Service in Service Oriented Architecture

    672 Views, 0 Comment(s), Published on: 06-01-2011 16:36 by izzuddin to Izzuddin Gumilar's Blog
    | More
    Filed under: , , ,