Exemplo n.º 1
0
        new public static void OnChartDataChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            __setup(sender);

            IntHistogram chart = sender as IntHistogram;

            chart.Children.Clear();
            chart._drawChart();
            chart._drawAxes();
        }
Exemplo n.º 2
0
        // --- __setup ---//
        // overrides the base class __setup
        new protected static void __setup(DependencyObject sender)
        {
            ChartBase.__setup(sender);
            IntHistogram chart = sender as IntHistogram;

            if (chart.ChartData.Data != null)
            {
                chart._xAxis_Y = chart._canvasBottom - chart.ChartData.XAxisPosition * (chart._canvasBottom - chart._canvasTop);
                chart._yAxis_X = chart._canvasLeft + chart.ChartData.YAxisPosition * (chart._canvasRight - chart._canvasLeft);

                if (chart.ChartData.Data.Length > 0)
                {
                    chart._xAxisStep = (chart.Width - chart.Padding - chart.Padding) / chart.ChartData.Data.Length;
                    chart._yAxisStep = (chart.Height - chart.Padding - chart.Padding) / (chart.ChartData.YMax - chart.ChartData.YMin);
                }
                else
                {
                    chart._xAxisStep = 1;
                    chart._yAxisStep = 1;
                }
            }
        }