コード例 #1
0
        private void AddData(LineChartControlLib myLineChart)
        {
            myLineChart.DataCollection.DataList.Clear();

            DataSeries ds=new DataSeries
            {
                LineColor = Brushes.Blue,
                LineThickness = 1,
                SeriesName = "Sine"
            };
            ds.Symbols = new CircleSymbols
            {
                BorderColor = ds.LineColor,
                SymbolSize = 6
            };
            for (int i = 0; i < 15; i++)
            {
                double x = i/2.0;
                double y = Math.Sin(x);
                ds.LineSeries.Points.Add(new Point(x,y));
            }
            myLineChart.DataCollection.DataList.Add(ds);

            ds=new DataSeries
            {
                LineColor = Brushes.Red,
                SeriesName = "Cosine"
            };
            ds.Symbols = new OpenDiamondSymbols
            {
                BorderColor = ds.LineColor,
                SymbolSize = 6
            };
            for (int i = 0; i < 15; i++)
            {
                double x = i / 2.0;
                double y = Math.Cos(x);
                ds.LineSeries.Points.Add(new Point(x, y));
            }
            myLineChart.DataCollection.DataList.Add(ds);

            myLineChart.IsLegend = true;
            myLineChart.LegendPosition = LegendPosition.NorthEast;
        }
コード例 #2
0
 public LineChartControlLib()
 {
     InitializeComponent();
     ChartStyle = new ChartStyleGridLines();
     DataCollection = new DataCollection<DataSeries>();
     DataSeries = new DataSeries();
     ChartStyle.TextCanvas = TextCanvas;
     ChartStyle.ChartCanvas = ChartCanvas;
     Legend = new NorthEastLegend {Canvas = LegendCanvas};
 }