/// <summary>
        ///  Constructs a new instance of <see cref="T:Wisej.Web.Ext.ChartJS3.ChartClickEventArgs"/>.
        /// </summary>
        /// <param name="chart"></param>
        /// <param name="e"></param>
        internal ChartClickEventArgs(ChartJS3 chart, WidgetEventArgs e)
        {
            dynamic[]      points     = e.Data.data;
            List <int>     dataPoints = new List <int>();
            List <object>  values     = new List <object>();
            List <DataSet> dataSets   = new List <DataSet>();

            if (points != null)
            {
                // collect the points, values and datasets in the click range.
                foreach (dynamic point in points)
                {
                    int pointIndex   = point.pointIndex;
                    int dataSetIndex = point.dataSetIndex;

                    dataPoints.Add(pointIndex);
                    dataSets.Add(chart.DataSets[dataSetIndex]);
                    values.Add(chart.DataSets[dataSetIndex].Data[pointIndex]);
                }
            }

            this.DataSets   = dataSets.ToArray();
            this.DataPoints = dataPoints.ToArray();
            this.Values     = new object[this.DataPoints.Length];
            for (int i = 0; i < this.Values.Length; i++)
            {
                this.Values[i] = this.DataSets[i].Data[this.DataPoints[i]];
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a new instance of the <see cref="T:Wisej.Web.Ext.ChartJS3.Options"/> set.
        /// </summary>
        /// <param name="chart">The <see cref="T:Wisej.Web.Ext.ChartJS3.ChartJS3"/> that owns this set of options.</param>
        /// <param name="defaults">Default options to copy from.</param>
        public Options(ChartJS3 chart, Options defaults)
        {
            this.Chart = chart;

            if (defaults != null)
            {
                CopyFrom(defaults);
            }
        }
        /// <summary>
        /// Constructs a new instance of the <see cref="Wisej.Web.Ext.ChartJS3.DataSetCollection"/> class.
        /// </summary>
        /// <param name="chart">The <see cref="Wisej.Web.Ext.ChartJS3.ChartJS3"/> that owns this collection.</param>
        /// <param name="previous">The previous data sets to reload into this new collection, or null.</param>
        internal DataSetCollection(ChartJS3 chart, DataSetCollection previous)
        {
            if (chart == null)
            {
                throw new ArgumentNullException("chart");
            }

            this.chart = chart;

            // preserve the previous data sets.
            if (previous != null)
            {
                foreach (var d in previous)
                {
                    DataSet dataSet = CreateDataSet(d.Label);
                    dataSet.CopyFrom(d);
                    Add(dataSet);
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a new instance of the <see cref="T:Wisej.Web.Ext.ChartJS3.ScatterOptions"/> set.
 /// </summary>
 /// <param name="chart">The <see cref="T:Wisej.Web.Ext.ChartJS3.ChartJS3"/> that owns this set of options.</param>
 /// <param name="defaults">Default options to copy from.</param>
 public ScatterOptions(ChartJS3 chart, Options defaults)
     : base(chart, defaults)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructs a new instance of the <see cref="T:Wisej.Web.Ext.ChartJS3.BubbleOptions"/> set.
 /// </summary>
 /// <param name="chart">The <see cref="T:Wisej.Web.Ext.ChartJS3.ChartJS3"/> that owns this set of options.</param>
 /// <param name="defaults">Default options to copy from.</param>
 public BubbleOptions(ChartJS3 chart, Options defaults)
     : base(chart, defaults)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructs a new instance of the <see cref="T:Wisej.Web.Ext.ChartJS3.RadarOptions"/> set.
 /// </summary>
 /// <param name="chart">The <see cref="T:Wisej.Web.Ext.ChartJS3.ChartJS3"/> that owns this set of options.</param>
 /// <param name="defaults">Default options to copy from.</param>
 public RadarOptions(ChartJS3 chart, Options defaults)
     : base(chart, defaults)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructs a new instance of the <see cref="T:Wisej.Web.Ext.ChartJS3.DoughnutOptions"/> set.
 /// </summary>
 /// <param name="chart">The <see cref="T:Wisej.Web.Ext.ChartJS3.ChartJS3"/> that owns this set of options.</param>
 /// <param name="defaults">Default options to copy from.</param>
 public DoughnutOptions(ChartJS3 chart, Options defaults)
     : base(chart, defaults)
 {
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructs a new instance of the <see cref="T:Wisej.Web.Ext.ChartJS3.PolarAreaOptions"/> set.
 /// </summary>
 /// <param name="chart">The <see cref="T:Wisej.Web.Ext.ChartJS3.ChartJS3"/> that owns this set of options.</param>
 /// <param name="defaults">Default options to copy from.</param>
 public PolarAreaOptions(ChartJS3 chart, Options defaults)
     : base(chart, defaults)
 {
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Constructs a new instance of the <see cref="T:Wisej.Web.Ext.ChartJS3.LineOptions"/> set.
 /// </summary>
 /// <param name="chart">The <see cref="T:Wisej.Web.Ext.ChartJS3.ChartJS3"/> that owns this set of options.</param>
 /// <param name="defaults">Default options to copy from.</param>
 public LineOptions(ChartJS3 chart, Options defaults)
     : base(chart, defaults)
 {
 }