Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
InteractionTool
posted

Hi all,

I have a problem with the interaction tool. The chart is configured as ChartType composite. I add ChartAreas, Layers and Series dynamically. The following line of code

axisX_ = chartLayer.Grid["X"] as IAdvanceAxis;

returns always null. What's wrong?

Regards

 

My code:

TimeWindowSelector windowSelector = new TimeWindowSelector(Chart);
Chart.AddMouseDownTool(windowSelector);

 

class TimeWindowSelector : InteractionTool
    {
        #region nested class
        #endregion

        #region constants readonly attributes
        #endregion

        #region attributes
        private IAdvanceAxis axisX_;
        #endregion

        #region properties
        #endregion

        #region delegates
        #endregion

        #region event
        #endregion

        #region public methods
        public TimeWindowSelector(UltraChart chart)
            : base(chart)
        {

        }

        public override bool CanStart()
        {
            ChartLayer chartLayer = ChartCore.GetChartLayer();
            axisX_ = chartLayer.Grid["X"] as IAdvanceAxis;

            DateTime starting = (DateTime)this.axisX_.MapInverse(LastInput.ViewPoint.X);

            return true;
        }
        #endregion
    }