mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-11-30 02:58:37 +08:00
feat(Chart): support min/max on Y axis (#3890)
* feat: 支持 y 轴设置建议最大值最小值 * refactor: 重构代码 * chore: bump version 8.1.6
This commit is contained in:
parent
8e4777c2a1
commit
33508fc5de
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>8.1.5</Version>
|
||||
<Version>8.1.6</Version>
|
||||
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Chart</PackageTags>
|
||||
<Description>Bootstrap UI components extensions of Chart.js</Description>
|
||||
</PropertyGroup>
|
||||
|
@ -132,6 +132,22 @@ const getChartOption = function (option) {
|
||||
}
|
||||
}
|
||||
|
||||
if (option.options.yScalesSuggestedMin) {
|
||||
scale.y.suggestedMin = option.options.yScalesSuggestedMin;
|
||||
}
|
||||
|
||||
if (option.options.yScalesSuggestedMax) {
|
||||
scale.y.suggestedMax = option.options.yScalesSuggestedMax;
|
||||
}
|
||||
|
||||
if (option.options.yScalesMin) {
|
||||
scale.y.min = option.options.yScalesMin;
|
||||
}
|
||||
|
||||
if (option.options.yScalesMax) {
|
||||
scale.y.max = option.options.yScalesMax;
|
||||
}
|
||||
|
||||
let legend = {
|
||||
display: option.options.showLegend,
|
||||
position: option.options.legendPosition
|
||||
|
@ -29,13 +29,11 @@ public class ChartOptions
|
||||
/// <summary>
|
||||
/// 获得 Y 坐标轴实例集合
|
||||
/// </summary>
|
||||
|
||||
public ChartAxes Y { get; } = new ChartAxes();
|
||||
|
||||
/// <summary>
|
||||
/// 获得 Y2 坐标轴实例集合
|
||||
/// </summary>
|
||||
|
||||
public ChartAxes Y2 { get; } = new ChartAxes();
|
||||
|
||||
/// <summary>
|
||||
@ -134,6 +132,30 @@ public class ChartOptions
|
||||
/// </summary>
|
||||
public string? YScalesBorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 Y轴边界建议最小值
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? YScalesSuggestedMin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 Y轴边界建议最大值
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? YScalesSuggestedMax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 Y轴边界最小值
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? YScalesMin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 Y轴边界最大值
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? YScalesMax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 X轴网格线颜色
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user