Esempio n. 1
0
        void series_PrepareStyle(object sender, ChartPrepareStyleInfoEventArgs args)
        {
            // Compose the tooltip for each point:
            ChartSeries series = sender as ChartSeries;

            series.PointsToolTipFormat = "{2}";
            if (args != null)
            {
                DateTime dd = (DateTime)model.GetXData(args.Index);
                double   y  = this.chartControl1.Series[0].Points[args.Index].YValues[0];

                args.Style.ToolTip = "X= " + this.GetFormattedLabelText(dd) + ", Y= " + y.ToString("F01");
            }
            args.Handled = true;
        }
Esempio n. 2
0
        void ChartWebControl1_ChartFormatAxisLabel(object sender, ChartFormatAxisLabelEventArgs e)
        {
            if (e.AxisOrientation == ChartOrientation.Horizontal)
            {
                // Here we customize the label text for a point by getting the text from the model:
                ChartOversizedDataBindModel model = this.chartControl1.Series[0].SeriesModel as ChartOversizedDataBindModel;

                int index = (int)e.Value;
                if (model != null && index < model.Count)
                {
                    // The fact that the data type is DateTiem is based on our knowledge of the bound data source.
                    DateTime date = (DateTime)model.GetXData((int)e.Value);
                    e.Label = this.GetFormattedLabelText(date);
                }
                else
                {
                    e.Label = String.Empty;
                }

                e.Handled = true;
            }
        }