Ejemplo n.º 1
0
 private Chart2DContextData2(List <ChartCrood> data, ContinuousAxisContextData ydata, DiscreteAxisContextData xdata)
 {
     Data        = data.Where(it => !double.IsNaN(it.Y.Data)).ToList();
     YData       = ydata;
     XData       = xdata;
     XData.Items = new Dictionary <ContextDataItem, object>(Items);
     YData.Items = new Dictionary <ContextDataItem, object>(Items);
 }
Ejemplo n.º 2
0
        public Chart2DContextData2(List <ChartCrood> data)
        {
            Data  = data.Where(it => !double.IsNaN(it.Y.Data)).ToList();
            XData = new DiscreteAxisContextData(Data.Select(it => it.X).ToList());
            var ydata = Data.Select(it => it.Y).ToList();

            YData = new ContinuousAxisContextData(ydata);
        }
Ejemplo n.º 3
0
        private Chart2DContextData(Dictionary <IVariable, Value <double> > data, ContinuousAxisContextData ydata, DiscreteAxisContextData xdata)
        {
            Data        = data.Where(it => !double.IsNaN(it.Value.Data)).ToDictionary(it => it.Key, it => it.Value);
            YData       = ydata;
            XData       = xdata;
            XData.Items = new Dictionary <ContextDataItem, object>(Items);
            YData.Items = new Dictionary <ContextDataItem, object>(Items);

            _chartCroods = Data.Select(it => new ChartCrood(it.Key, it.Value)).ToList();
        }
Ejemplo n.º 4
0
        private Chart2DContextData2(List <IVariable> xData, List <double> yData)
        {
            if (xData.Count != yData.Count)
            {
                throw new ArgumentException($"{nameof(xData.Count)} != {nameof(yData.Count)}");
            }
            Data = new List <ChartCrood>();
            var index = 0;

            foreach (var item in xData)
            {
                if (double.IsNaN(yData[index]))
                {
                    continue;
                }
                Data.Add(new ChartCrood(item, new FormattableValue <double>(yData[index])));
                index++;
            }
            XData       = new DiscreteAxisContextData(xData);
            YData       = new ContinuousAxisContextData(yData);
            XData.Items = new Dictionary <ContextDataItem, object>(Items);
            YData.Items = new Dictionary <ContextDataItem, object>(Items);
        }
Ejemplo n.º 5
0
        public Chart2DContextData(Dictionary <IVariable, Value <double> > data)
        {
            Data = new Dictionary <IVariable, Value <double> >();
            List <Value <double> > yValues = new List <Value <double> >();
            List <IVariable>       xValues = new List <IVariable>();

            _chartCroods = new List <ChartCrood>();

            foreach (var item in data)
            {
                if (double.IsNaN(item.Value.Data))
                {
                    continue;
                }
                Data[item.Key] = item.Value;
                yValues.Add(item.Value);
                xValues.Add(item.Key);
                _chartCroods.Add(new ChartCrood(item.Key, item.Value));
            }
            YData       = new ContinuousAxisContextData(yValues);
            XData       = new DiscreteAxisContextData(xValues);
            XData.Items = new Dictionary <ContextDataItem, object>(Items);
            YData.Items = new Dictionary <ContextDataItem, object>(Items);
        }