Пример #1
0
        public MainWindow()
        {
            InitializeComponent();
            this.AreGridEnabledButton.IsChecked = true;
            settings = new WPFCanvasChartSettings();
            settings.MaxXZoomStep = 200.0f;
            settings.MaxYZoomStep = 200.0f;
            pen.Freeze();
            brush.Freeze();
            this.Loaded += (sender, e) =>
            {
                // chart must created after all UI elements are loaded (canvas, scroll bars, etc...)
                settings.HandleSizeChanged = false;
                settings.FontSize          = 4;
                settings.PenForGrid        = new Pen((Brush) new BrushConverter().ConvertFromString("#66000000"), 0.3);
                settings.PenForAxis        = new Pen((Brush) new BrushConverter().ConvertFromString("#CC000000"), 0.5);
                xAxisInterpolator          = new WPFCanvasChartIntInterpolator();
                yAxisInterpolator          = new WPFCanvasChartFloatInterpolator();
                cc = new WPFCanvasChartComponent();
                cc.Init(this.Canvas, HorizScroll, VertScroll, this, settings, xAxisInterpolator, yAxisInterpolator);
                cc.SetMinMax(-5, 5, 10, 20);
                cc.DrawChart();
            };

            this.Closed += (sender, e) =>
            {
                cc.Dispose();
            };
        }
Пример #2
0
 private void Refresh()
 {
     cc.DrawChart();
 }