每个系列项目的颜色 @code{公共类MyChartDataModel{公共字符串类别{get;设置;} public double ItemValue {get;设置;}公共字符串颜色{获取;设置;}} public List theData = new List {new MyChartDataModel {Category = "Product 1", ItemValue = 2, Color = "red"}, new MyChartDataModel {Category = "Product 2", ItemValue = 3, Color = "#00ff00"}}, new MyChartDataModel {Category = "Product 3", ItemValue = 4, Color = "#00f"}}; }
@*跳过渲染每秒钟标签和自定义他们有边框,填充和旋转。*@ @* With this you set the rendering step, in this case it will skip the rendering of every second label *@ @code { public List series1Data = new List() { 10, 2, 5, 6, 8, 8, 13, 11, 4, 9, 10, 15, 14, 3, 2 }; public List series2Data = new List() { 5, 8, 2, 7, 6, 11, 14, 13, 8, 7, 2, 7, 5, 9, 11 }; public string[] xAxisItems = new string[15]; protected override void OnInitialized() { for (int i = 0; i < 15; i++) { xAxisItems[i] = $"looooong label {i + 1}"; } base.OnInitialized(); } }