Example #1
0
 private void SmallChartMenuItem_Click(object sender, RoutedEventArgs e)
 {
     settings.CoordXSteps = 10;
     chartType            = ChartType.Small;
     cc.SetMinMax(2, 10, -5, 11.5);
     Refresh();
 }
Example #2
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();
            };
        }
Example #3
0
 public void UpdateChart(IWPFCanvasChartComponent chart)
 {
     chart.SetMinMax(minX, maxX, minY, maxY);
 }