I want to create pie chart in windows phone 8 application in visual studio 2013. Kindly guide me step by step how to use this third party tool and please tell me each step I have installed this controls but I dont know how to use this.
Hello Aamar,
Thank you for your post. I have been looking into your question and regarding the Windows Phone 8 development, you can ream detailed information on how you can start with Windows Phone 8 here: http://help.infragistics.com/doc/WindowsPhone/2014.1/CLR4.0?page=SL_DV_Getting_Started_Prerequisites.html.
Also, here: http://help.infragistics.com/doc/WindowsPhone/2014.1/CLR4.0?page=xamPieChart_Data_Binding.html, you can find detailed information on how you can create a XamPieChart and bind it to a collection.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir, MCPD
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Hi Krasimir,
I followed your instructions but there is some error in my code kindly check my code and resolve my error. Error in <local:Data>
Error description: Data does not exist in the namespace "clr-namespace:phonechart"
in Xaml:
<UserControl x:Class="phonechart.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ig="clr-namespace:Infragistics.Controls.Charts;assembly=InfragisticsWP8.Controls.Charts.XamDataChart.v14.1" xmlns:local="clr-namespace:phonechart" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources> <local:Data x:Key="data" /> </Grid.Resources>
<ig:ItemLegend x:Name="Legend" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="10" Padding="10,5,10,5" />
<ig:XamPieChart Name="pieChart" Grid.Row="2" ItemsSource="{StaticResource data}" LabelMemberPath="Label" ValueMemberPath="Value" ToolTip="{}{Label}" Legend="{Binding ElementName=Legend}" /> </Grid></UserControl>
in C#:
using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Navigation;using Microsoft.Phone.Controls;using Microsoft.Phone.Shell;using phonechart.Resources;using System.Collections.ObjectModel;using Infragistics.Controls.Charts;using Infragistics.Collections;using System.ServiceModel;
namespace phonechart{ public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } }
public class DataItem { public string Label { get; set; } public double Value { get; set; } }
public class Data : ObservableCollection<DataItem> { public Data() { Add(new DataItem { Label = "Item 1", Value = 5 }); Add(new DataItem { Label = "Item 2", Value = 6 }); Add(new DataItem { Label = "Item 3", Value = 3 }); Add(new DataItem { Label = "Item 4", Value = 7 }); Add(new DataItem { Label = "Item 5", Value = 5 }); } }}