Пример #1
0
        void FillSeries(MarkerSeries2D series)
        {
            if (series == null)
            {
                return;
            }
            AreaSeries2D areaSeries = series as AreaSeries2D;

            if (areaSeries != null)
            {
                areaSeries.Transparency  = 0.8;
                areaSeries.MarkerVisible = true;
            }
            LineSeries2D lineSeries = series as LineSeries2D;

            if (lineSeries != null)
            {
                lineSeries.MarkerVisible = true;
            }
            series.ColorEach = true;
            series.AnimationAutoStartMode = AnimationAutoStartMode.SetStartState;
            AddPoint(series, new SeriesPoint(1.0, 2.1), 1.0);
            AddPoint(series, new SeriesPoint(2.0, 1.4), 2.0);
            AddPoint(series, new SeriesPoint(3.0, 1.1), 4.0);
            AddPoint(series, new SeriesPoint(4.0, 1.9), 3.0);
            AddPoint(series, new SeriesPoint(5.0, 3.1), 2.5);
            AddPoint(series, new SeriesPoint(6.0, 2.4), 1.7);
            AddPoint(series, new SeriesPoint(7.0, 2.6), 3.9);
            AddPoint(series, new SeriesPoint(8.0, 1.9), 2.8);
            AddPoint(series, new SeriesPoint(9.0, 3.2), 2.1);
            AddPoint(series, new SeriesPoint(10.0, 3.5), 1.3);
            ((ISupportMarker2D)series).MarkerModel = chart.Resources["CustomMarker2DModel"] as CustomMarker2DModel;
            series.Label = new SeriesLabel();
            series.Label.ConnectorVisible       = false;
            series.Label.ResolveOverlappingMode = ResolveOverlappingMode.Default;
            DataTemplate labelTemplate = chart.Resources["labelTemplate"] as DataTemplate;

            if (labelTemplate != null)
            {
                series.Label.ElementTemplate = labelTemplate;
                series.Label.RenderMode      = LabelRenderMode.CustomShape;
            }
            if (!(series is BubbleSeries2D))
            {
                ((ISupportMarker2D)series).MarkerSize = 19;
                series.Label.Indent = 15;
            }
            else
            {
                series.Label.Indent = 5;
                MarkerSeries2D.SetAngle(series.Label, 90);
                BubbleSeries2D.SetLabelPosition(series.Label, Bubble2DLabelPosition.Outside);
            }
            chart.Diagram.Series.Clear();
            chart.Diagram.Series.Add(series);
            if (!loading)
            {
                chart.Animate();
            }
        }
Пример #2
0
        void AddPoint(MarkerSeries2D series, SeriesPoint point, double weight)
        {
            BubbleSeries2D bubbleSeries = series as BubbleSeries2D;

            if (bubbleSeries != null)
            {
                BubbleSeries2D.SetWeight(point, weight);
            }
            series.Points.Add(point);
        }
Пример #3
0
 void InitializeBubbleSeries(BubbleSeries2D series)
 {
     series.ColorEach          = true;
     series.MinSize            = 1;
     series.MaxSize            = 2;
     series.DataSource         = bubbleDataSource;
     series.ArgumentDataMember = "Argument";
     series.ValueDataMember    = "Value";
     series.WeightDataMember   = "Weight";
 }