/// <summary>
 /// Creates a new chart.
 /// </summary>
 void CreateChart()
 {
     if (TabControlBase.SelectedTab != TabPageChart) return;
     ChartData chartData = GetChartDataObject();
     chart = new Chart(chartData) {Parent = TabPageChart, Dock = DockStyle.Fill};
     chart.InitChart(chartData);
 }
        /// <summary>
        ///     Show the full Account Chart
        /// </summary>
        private void ShowAccountChartOnClick(object sender, EventArgs e)
        {
            if (!Data.IsData || !Data.IsResult) return;
            var chart = new Chart
                {
                    BarPixels = Configs.BalanceChartZoom,
                    ShowInfoPanel = Configs.BalanceChartInfoPanel,
                    ShowDynInfo = Configs.BalanceChartDynamicInfo,
                    ShowGrid = Configs.BalanceChartGrid,
                    ShowCross = Configs.BalanceChartCross,
                    ShowVolume = Configs.BalanceChartVolume,
                    ShowPositionLots = Configs.BalanceChartLots,
                    ShowOrders = Configs.BalanceChartEntryExitPoints,
                    ShowPositionPrice = Configs.BalanceChartCorrectedPositionPrice,
                    ShowBalanceEquity = Configs.BalanceChartBalanceEquityChart,
                    ShowFloatingPL = Configs.BalanceChartFloatingPLChart,
                    ShowIndicators = Configs.BalanceChartIndicators,
                    ShowAmbiguousBars = Configs.BalanceChartAmbiguousMark,
                    TrueCharts = Configs.BalanceChartTrueCharts
                };


            chart.ShowDialog();

            Configs.BalanceChartZoom = chart.BarPixels;
            Configs.BalanceChartInfoPanel = chart.ShowInfoPanel;
            Configs.BalanceChartDynamicInfo = chart.ShowDynInfo;
            Configs.BalanceChartGrid = chart.ShowGrid;
            Configs.BalanceChartCross = chart.ShowCross;
            Configs.BalanceChartVolume = chart.ShowVolume;
            Configs.BalanceChartLots = chart.ShowPositionLots;
            Configs.BalanceChartEntryExitPoints = chart.ShowOrders;
            Configs.BalanceChartCorrectedPositionPrice = chart.ShowPositionPrice;
            Configs.BalanceChartBalanceEquityChart = chart.ShowBalanceEquity;
            Configs.BalanceChartFloatingPLChart = chart.ShowFloatingPL;
            Configs.BalanceChartIndicators = chart.ShowIndicators;
            Configs.BalanceChartAmbiguousMark = chart.ShowAmbiguousBars;
            Configs.BalanceChartTrueCharts = chart.TrueCharts;
        }
 /// <summary>
 /// Disposes the chart.
 /// </summary>
 private void DisposeChart()
 {
     if (chart != null)
     {
         try
         {
             chart.Dispose();
         }
         finally
         {
             chart = null;
         }
     }
 }