/// <summary>
        /// Updates graphic with new data series
        /// </summary>
        public override void FillData <TRecord>(IEnumerable <TRecord> newRecords, SerieSetting <TRecord>[] newSerieSettings)
        {
            plotAreaUpper.ClearRenderers();
            plotAreaLower.ClearRenderers();
            legendScrollerX.Reset();
            legendScrollerYUpper.Reset();
            legendScrollerYLower.Reset();

            addGridLineRenderers();

            base.FillData <TRecord>(newRecords, newSerieSettings);

            //MaxValueTextBlock.Text = maxValue.ToString("N");
            ////ValueXYLegend.MaxValue = maxValue;
            //if (IsShowYFromZero) {
            //  MinValueTextBlock.Visibility = Visibility.Hidden;
            //  minValue = 0;
            //  //ValueXYLegend.MinValue = 0;
            //} else {
            //  MinValueTextBlock.Text = minValue.ToString("N");
            //  //ValueXYLegend.MinValue = minValue;
            //}
            //if (IsShowOpenClose && MainSerieIndex>=0 && MainSerieIndex<newSerieSettings.Length && countRecords>0) {
            //  double open = valueLists[MainSerieIndex][0];
            //  double close = valueLists[MainSerieIndex][(int)countRecords-1];
            //  PercentageTextBlock.Text = ((close-open)/open).ToString("P");
            //  CloseTextBlock.Text = "C: " + close.ToString("N");
            //  AverageTextBlock.Text = "A: " + (averageValue/countRecords).ToString("N");
            //  OpenTextBlock.Text = "O: " + open.ToString("N");
            //} else {
            //  PercentageTextBlock.Visibility = Visibility.Hidden;
            //  OpenTextBlock.Visibility = Visibility.Hidden;
            //  AverageTextBlock.Visibility = Visibility.Hidden;
            //  CloseTextBlock.Visibility = Visibility.Hidden;
            //}

            //graphPolylines = new Polyline[newSerieSettings.Length];
            //highLowPolygons = new Polygon[newSerieSettings.Length];//half would be enough, but easier for programming, only few bytes waisted
            //closePoints = new List<Point>[newSerieSettings.Length];//to draw line back for Polygon

            for (int serieIndex = 0; serieIndex < newSerieSettings.Length; serieIndex++)
            {
                Renderer?renderer = CreateGraphRenderer <TRecord>(serieIndex, newSerieSettings[serieIndex]);
                if (renderer != null)
                {
                    if (newSerieSettings[serieIndex].Group == 0)
                    {
                        AddRenderer(renderer, plotAreaUpper, legendScrollerX, legendScrollerYUpper);
                    }
                    else if (newSerieSettings[serieIndex].Group == 1)
                    {
                        AddRenderer(renderer, plotAreaLower, legendScrollerX, legendScrollerYLower);
                    }
                    else
                    {
                        throw new Exception("Only group 0 and 1 are supported. SerieSettings[" + serieIndex + "]: " + newSerieSettings[serieIndex]);
                    }
                }
            }
        }
        /// <summary>
        /// Updates graphic with new data series
        /// </summary>
        public override void FillData <TRecord>(IEnumerable <TRecord> newRecords, SerieSetting <TRecord>[] newSerieSettings)
        {
            plotArea.ClearRenderers();
            legendScrollerX.Reset();
            legendScrollerY.Reset();

            addGridLineRenderers();

            base.FillData <TRecord>(newRecords, newSerieSettings);

            for (int serieIndex = 0; serieIndex < newSerieSettings.Length; serieIndex++)
            {
                Renderer?renderer = CreateGraphRenderer <TRecord>(serieIndex, newSerieSettings[serieIndex]);
                if (renderer != null)
                {
                    if (newSerieSettings[serieIndex].Group == 0)
                    {
                        AddRenderer(renderer, plotArea, legendScrollerX, legendScrollerY);
                    }
                    else
                    {
                        throw new Exception("Only group 0 is supported. SerieSettings[" + serieIndex + "]: " + newSerieSettings[serieIndex]);
                    }
                }
            }
        }