void CreateData() { XDocument document = DataLoader.LoadFromXmlResource("/Data/Movies.xml"); if (document != null) { foreach (XElement element in document.Element("Movies").Elements()) { Series series = new Series(); series.View = new PointSeriesView(); series.DisplayName = element.Element("Name").Value; series.Data = new DataPointCollection() { ArgumentScaleType = ScaleType.Numerical }; series.View.ShowLabels = true; series.View.LabelOptions = new SeriesLabelOptions(); series.View.LabelOptions.ShowConnectors = false; series.View.LabelOptions.FontSize = 12; series.View.LabelOptions.Pattern = "{S}"; series.View.LabelOptions.Indent = 10; series.View.ToolTipPointPattern = "Budget : ${A}M\n" + "Grosses: ${V}M"; MarkerSeriesView.SetAngle(series.View.LabelOptions, 20); double argument = Convert.ToDouble(element.Element("ProductionBudget").Value, CultureInfo.InvariantCulture); double value = Convert.ToDouble(element.Element("WorlwideGrosses").Value, CultureInfo.InvariantCulture); ((DataPointCollection)series.Data).Add(new DataPoint(argument, value)); cartesianChart.Series.Add(series); } } }
void OnAngleValueChanged(double oldValue) { if (cartesianChart == null) { return; } foreach (Series series in cartesianChart.Series) { MarkerSeriesView.SetAngle(((PointSeriesView)series.View).LabelOptions, Angle); } }