private static void SetYAxisForChart(LineChartDataDisplay chart, ChartLayerAppearance chartAppearance)
 {
     chartAppearance.AxisY = chart.FindYAxis(40, "##0.000", AxisNumber.Y2_Axis);
     chartAppearance.AxisY.RangeType = AxisRangeType.Custom;
     var max = (double) chartAppearance.Series.GetDataMaximum(AxisDataType.Numeric);
     var min = (double) chartAppearance.Series.GetDataMinimum(AxisDataType.Numeric);
     chartAppearance.AxisY.RangeMax = max + (max - min)*0.1;
     chartAppearance.AxisY.RangeMin = min - (max - min)*0.1;
 }
        public void HistSeriesCandleChart()
        {
            var data = BbgData.getOHLCSeriesFromBbg(new DateTime(2015, 1, 1), "EUR Curncy", false);
            var chart = new LineChartDataDisplay();
            SI.Controls.LookFeel.ProcessControl(chart);
            chart.AddCandleSeries(data, "candle chart", 40, "###0.000");
            var max = data.GetColumnValues(1).Max();
            var min = data.GetColumnValues(2).Min();
            chart.FindYAxis(40).RangeType = AxisRangeType.Custom;
            chart.FindYAxis(40).RangeMax = max + (max - min) * 0.1;
            chart.FindYAxis(40).RangeMin = min - (max - min) * 0.1;

            var form = chart.DisplayInShowForm("DeMark Chart");
            Application.Run(form);
        }