FlexChart
FlexChart
Scatter
このサンプルは、WebGLでGPUを使用して大きなデータの散布図を高速に描画する方法を示しています。
機能
サンプル
設定
説明
このサンプルは、WebGLでGPUを使用して大きなデータの散布図を高速に描画する方法を示しています。
ソース
ScatterController.cs
using System; using System.Collections.Generic; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using MvcExplorer.Models; namespace MvcExplorer.Controllers { public partial class FlexChartController : Controller { private readonly ControlOptions _options = new ControlOptions { Options = new OptionDictionary { {"Items",new OptionItem{Values = new List<string> {"1000", "10000", "100000", "200000", "500000"},CurrentValue = "100000"}}, {"RenderEngine", new OptionItem {Values = new List<string> {"Svg", "WebGL"}, CurrentValue = "WebGL"}}, } }; public ActionResult Scatter(IFormCollection collection) { _options.LoadPostData(collection); ViewBag.DemoOptions = _options; Random ran = new Random(); var model = Dot.GetData(ran.NextDouble() - 0.5, ran.NextDouble() - 0.5, Convert.ToInt32(_options.Options["items"].CurrentValue), 0.5); return View(model); } } }
Scatter.cshtml
@using C1.Web.Mvc.Chart @model List<Dot> @{ ControlOptions optionsModel = ViewBag.DemoOptions; ViewBag.DemoSettings = true; } <c1-flex-chart id="theChart" chart-type="Scatter" binding-x="X" binding="Y" render-engine="@((RenderEngine)Enum.Parse(typeof(RenderEngine), optionsModel.Options["RenderEngine"].CurrentValue))"> <c1-flex-chart-axis c1-property="AxisX" min="-2" max="2"></c1-flex-chart-axis> <c1-flex-chart-axis c1-property="AxisY" min="-2" max="2" axis-line="true" major-grid="false"></c1-flex-chart-axis> <c1-flex-chart-series name="Ser 1" symbol-marker="Dot"></c1-flex-chart-series> <c1-items-source source-collection="Model"></c1-items-source> <c1-chart-gestures mouse-action="Zoom" interactive-axes="XY" scale-x="1" scale-y="1" pos-x="0.5f" pos-y="0.5f"></c1-chart-gestures> </c1-flex-chart> @section Settings{ @await Html.PartialAsync("_OptionsMenu", optionsModel) } @section Summary{ @(Html.Raw(FlexChartRes.RenderEngine_Description_Text0)) } @section Description{ @(Html.Raw(FlexChartRes.RenderEngine_Description_Text0)) }
マニュアル