Пример #1
0
        public override void UpdateTooltipSerieParams(int dataIndex, bool showCategory, string category,
                                                      string marker, string itemFormatter, string numericFormatter,
                                                      ref List <SerieParams> paramList, ref string title)
        {
            dataIndex = serie.context.pointerItemDataIndex;
            if (dataIndex < 0)
            {
                return;
            }

            var serieData = serie.GetSerieData(dataIndex);

            if (serieData == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(category))
            {
                var xAxis = chart.GetChartComponent <XAxis>(serie.xAxisIndex);
                if (xAxis != null)
                {
                    category = xAxis.GetData((int)serieData.GetData(0));
                }
            }

            title = serie.serieName;

            var param = serie.context.param;

            param.serieName        = serie.serieName;
            param.serieIndex       = serie.index;
            param.dimension        = defaultDimension;
            param.dataCount        = serie.dataCount;
            param.serieData        = serieData;
            param.color            = serieData.context.color;
            param.marker           = SerieHelper.GetItemMarker(serie, serieData, marker);
            param.itemFormatter    = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
            param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
            param.columns.Clear();

            param.columns.Add(param.marker);
            param.columns.Add(category);
            param.columns.Add(ChartCached.NumberToStr(serieData.GetData(defaultDimension), param.numericFormatter));

            paramList.Add(param);
        }
Пример #2
0
        public override void UpdateTooltipSerieParams(int dataIndex, bool showCategory, string category,
                                                      string marker, string itemFormatter, string numericFormatter,
                                                      ref List <SerieParams> paramList, ref string title)
        {
            if (dataIndex < 0)
            {
                dataIndex = serie.context.pointerItemDataIndex;
            }

            if (dataIndex < 0)
            {
                return;
            }

            var serieData = serie.GetSerieData(dataIndex);

            if (serieData == null)
            {
                return;
            }

            var param = serie.context.param;

            param.serieName        = serie.serieName;
            param.serieIndex       = serie.index;
            param.category         = category;
            param.dimension        = defaultDimension;
            param.serieData        = serieData;
            param.dataCount        = serie.dataCount;
            param.value            = serieData.GetData(0);
            param.total            = serieData.GetData(1);
            param.color            = SerieHelper.GetItemColor(serie, serieData, chart.theme, dataIndex, false);
            param.marker           = SerieHelper.GetItemMarker(serie, serieData, marker);
            param.itemFormatter    = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
            param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);;
            param.columns.Clear();

            param.columns.Add(param.marker);
            param.columns.Add(serieData.name);
            param.columns.Add(ChartCached.NumberToStr(param.value, param.numericFormatter));

            paramList.Add(param);
        }
        public override void UpdateTooltipSerieParams(int dataIndex, bool showCategory, string category,
                                                      string marker, string itemFormatter, string numericFormatter,
                                                      ref List <SerieParams> paramList, ref string title)
        {
            if (dataIndex < 0)
            {
                dataIndex = serie.context.pointerItemDataIndex;
            }

            if (dataIndex < 0)
            {
                return;
            }

            var serieData = serie.GetSerieData(dataIndex);

            if (serieData == null)
            {
                return;
            }

            title = category;

            var color               = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, false);
            var newMarker           = SerieHelper.GetItemMarker(serie, serieData, marker);
            var newItemFormatter    = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
            var newNumericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);

            var param = serie.context.param;

            param.serieName        = serie.serieName;
            param.serieIndex       = serie.index;
            param.category         = category;
            param.dimension        = 1;
            param.serieData        = serieData;
            param.dataCount        = serie.dataCount;
            param.value            = 0;
            param.total            = 0;
            param.color            = color;
            param.marker           = newMarker;
            param.itemFormatter    = newItemFormatter;
            param.numericFormatter = newNumericFormatter;
            param.columns.Clear();

            param.columns.Add(param.marker);
            param.columns.Add(serie.serieName);
            param.columns.Add(string.Empty);

            paramList.Add(param);
            for (int i = 0; i < 4; i++)
            {
                param                  = new SerieParams();
                param.serieName        = serie.serieName;
                param.serieIndex       = serie.index;
                param.dimension        = i;
                param.serieData        = serieData;
                param.dataCount        = serie.dataCount;
                param.value            = serieData.GetData(i);
                param.total            = SerieHelper.GetMaxData(serie, i);
                param.color            = color;
                param.marker           = newMarker;
                param.itemFormatter    = newItemFormatter;
                param.numericFormatter = newNumericFormatter;
                param.columns.Clear();

                param.columns.Add(param.marker);
                param.columns.Add(XCSettings.lang.GetCandlestickDimensionName(i));
                param.columns.Add(ChartCached.NumberToStr(param.value, param.numericFormatter));

                paramList.Add(param);
            }
        }
        public override void UpdateTooltipSerieParams(int dataIndex, bool showCategory, string category,
                                                      string marker, string itemFormatter, string numericFormatter,
                                                      ref List <SerieParams> paramList, ref string title)
        {
            if (!serie.context.pointerEnter)
            {
                return;
            }
            dataIndex = serie.context.pointerItemDataIndex;
            if (dataIndex < 0)
            {
                return;
            }

            if (serie.radarType == RadarType.Single)
            {
                UpdateItemSerieParams(ref paramList, ref title, dataIndex, category,
                                      marker, itemFormatter, numericFormatter);
                return;
            }

            var radar = chart.GetChartComponent <RadarCoord>(serie.radarIndex);

            if (radar == null)
            {
                return;
            }

            var serieData = serie.GetSerieData(dataIndex);

            if (serieData == null)
            {
                return;
            }

            var color = SerieHelper.GetItemColor(serie, serieData, chart.theme, dataIndex, false);;

            title = serieData.name;
            for (int i = 0; i < serieData.data.Count; i++)
            {
                var indicator = radar.GetIndicator(i);
                if (indicator == null)
                {
                    continue;
                }

                var param = new SerieParams();
                param.serieName        = serie.serieName;
                param.serieIndex       = serie.index;
                param.dimension        = i;
                param.serieData        = serieData;
                param.dataCount        = serie.dataCount;
                param.value            = serieData.GetData(i);
                param.total            = indicator.max;
                param.color            = color;
                param.marker           = SerieHelper.GetItemMarker(serie, serieData, marker);
                param.itemFormatter    = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
                param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
                param.columns.Clear();

                param.columns.Add(param.marker);
                param.columns.Add(indicator.name);
                param.columns.Add(ChartCached.NumberToStr(serieData.GetData(i), param.numericFormatter));

                paramList.Add(param);
            }
        }