0
votes

I want to hide chart labels when there is no related point on chart. How can i do this? On the pictures below you can see a series of two points with 2 min interval. I want to hide middle label, since there is no related data point. CustomDrawAxisLabel event is not working since for some reason it fires for each label. Here is what i am trying to do inside of this event:

if (axis is AxisX || axis is AxisX3D || axis is RadarAxisX)
{
    DateTime dateTime = (DateTime)e.Item.AxisValue;
    if (dateTime == null)
    {
        e.Item.Text = "";
    }

It's not working since e.Item.AxisValue returns me current axis label value (including middle one i want to hide), not related chart point. How can i access chart data inside this event by axis value?

Actual:

enter image description here

Desired:

enter image description here

1
provide more code that how are you binding chart control and what is your datasource schema. if you provide more details then it would be better.. one more thing you should iterate through data source and check whether this axis value exists in respective axis data.Niranjan Singh
Have you tried any of the things we have suggested when you posted this question the last time???TaW
Of course not. Why? I thought that my problem can be fixed by asking the same question repeatedly.johnny-b-goode

1 Answers

0
votes

Well, the only thing i have found is to check whether current label has related value in chart manually. Ii no - use empty string for this label.