protected static void __setup(DependencyObject sender) { ChartBase chart = sender as ChartBase; chart._canvasLeft = chart.Padding; chart._canvasTop = chart.Padding; chart._canvasRight = chart.Width - chart.Padding; chart._canvasBottom = chart.Height - chart.Padding; }
// --- __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; } } }