Exemplo n.º 1
0
        public async Task <RatioFrame> getIncrementalRatioFrames(int seconds, int last, IJSRuntime jSRuntime)
        {
            string serverUrl = Configuration["ServerUrl"];

            controllerUrl = $"{serverUrl}api/BookColumns/";

            await Task.Yield();

            var route = $"getIncrementalRatioFrames/{seconds}/{last}";

            RatioFrame values = new RatioFrame();

#if tracing
            JSRuntimeExtensions.GroupTable(jSRuntime, values, "new AverageSizes");
#endif
            try
            {
                values = await Http.GetFromJsonAsync <RatioFrame>($"{controllerUrl}{route}");
            }
            catch { }

#if tracing
            JSRuntimeExtensions.GroupTable(jSRuntime, values, "AverageSizes Ratios values");
#endif

            return(values);
        }
Exemplo n.º 2
0
        private async Task Chart_AppendData(RatioFrame ratioFrame)
        {
            var lstData = new List <float?> {
                (float?)Convert.ToDouble(ratioFrame[buysField]), (float?)Convert.ToDouble(ratioFrame.markPrice), (float?)Convert.ToDouble(ratioFrame[sellsField])
            };

            chartSeriesJson = JsonSerializer.Serialize <float?[]>(lstData.ToArray());
        }