Pre loader

Tag: AxisBase

0 votes
3k views

hello, i have an exception.
see the try catch

public class CategoryDateTimeAxisEx : CategoryDateTimeAxis
{
    public override IComparable GetDataValue(double pixelCoordinate)
    {
        var dataValue = DateTime.MinValue;

        var coordCalc = GetCurrentCoordinateCalculator();
        if (coordCalc != null)
        {
            // Returns the index of a dataPoint, need to transform it to a dataValue
            var value = coordCalc.GetDataValue(pixelCoordinate);

            var catCoordCalc = coordCalc as ICategoryCoordinateCalculator<DateTime>;
            try
            {
                dataValue = catCoordCalc?.TransformIndexToData((int)value) ?? value.ToDateTime();
            }
            catch (Exception e)
            {
                 //TransformIndexToData() throw exception because catCoordCalc.BaseXValues is null,
                 //it only happend when my mouse over SciSurface and move faster on app startup
            } 
        }
        return dataValue;
    }
}

I use this class and override function now, it can work .but i don’t like this way.

Showing 1 result

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies