Hi,
E.g. try these two approaches in LineChart example:
var yValues = new List<double> { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24 };
var yTooltips = yValues.Select(y => y.ToString()).ToList();
lineChart.Series.Add(
new Series2D(
new List<double> { 0,1,2,3,4,5,6,7,8,9,10,11 },
yValues, yTooltips
)
{
Title = "Series 2",
SupportedLabels = LabelKinds.ToolTip /*| LabelKinds.InnerLabel*/
});
lineChart.Series.Add(
new YTooltip(
new Series2D(
new List<double> { 0,1,2,3,4,5,6,7,8,9,10,11 },
new List<double> { 1,2,3,4,5,6,7,8,9,10,11,12 },
labels
)
{ Title = "Series 1" }));
class YTooltip : Series
{
public LabelKinds SupportedLabels =>
series.SupportedLabels | LabelKinds.ToolTip;
public string GetLabel(int index, LabelKinds kind)
{
if (kind == LabelKinds.ToolTip)
return series.GetValue(index, 1).ToString();
return series.GetLabel(index, kind);
}
public YTooltip(Series series)
{
Debug.Assert(series.Dimensions >= 2);
this.series = series;
}
public int Size => series.Size;
public int Dimensions => series.Dimensions;
public string Title => series.Title;
public double GetValue(int index, int dimension)
{
return series.GetValue(index, dimension);
}
public bool IsEmphasized(int index) { return series.IsEmphasized(index); }
public bool IsSorted(int dimension) { return false; }
public event EventHandler DataChanged;
Series series;
}
Regards,
Slavcho
Mindfusion