mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-07-08 18:16:08 +00:00
Column and bar radius is not applied in some cases. Fixes #1464.
This commit is contained in:
@@ -16,5 +16,11 @@ namespace Radzen.Blazor
|
||||
/// Gets the values for category.
|
||||
/// </summary>
|
||||
IEnumerable<double> ValuesForCategory(double category);
|
||||
/// <summary>
|
||||
/// Gets the items for category.
|
||||
/// </summary>
|
||||
/// <param name="category"></param>
|
||||
/// <returns></returns>
|
||||
IEnumerable<object> ItemsForCategory(double category);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,13 @@ namespace Radzen.Blazor
|
||||
/// </summary>
|
||||
IEnumerable<double> ValuesForCategory(double category);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the items for category.
|
||||
/// </summary>
|
||||
/// <param name="category"></param>
|
||||
/// <returns></returns>
|
||||
IEnumerable<object> ItemsForCategory(double category);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value at the specified index.
|
||||
/// </summary>
|
||||
|
||||
@@ -32,9 +32,15 @@
|
||||
var itemValue = Value(data);
|
||||
var radius = Chart.BarOptions.Radius;
|
||||
|
||||
if (radius > height / 2 || barIndex < barSeries.Count - 1)
|
||||
if (radius > 0)
|
||||
{
|
||||
radius = 0;
|
||||
var items = barSeries.SelectMany(series => series.ItemsForCategory(category(data))).ToList();
|
||||
var index = items.IndexOf(data);
|
||||
|
||||
if (radius > height / 2 || index < items.Count - 1)
|
||||
{
|
||||
radius = 0;
|
||||
}
|
||||
}
|
||||
var x0 = GetBarLeft(data, barIndex, category, barSeries);
|
||||
|
||||
|
||||
@@ -216,6 +216,18 @@ namespace Radzen.Blazor
|
||||
return Items.Where(item => category(item) == value).Select(Value);
|
||||
}
|
||||
|
||||
IEnumerable<object> IChartStackedBarSeries.ItemsForCategory(double value)
|
||||
{
|
||||
if (Items == null)
|
||||
{
|
||||
return Enumerable.Empty<object>();
|
||||
}
|
||||
|
||||
var category = ComposeCategory(Chart.ValueScale);
|
||||
|
||||
return Items.Where(item => category(item) == value).Cast<object>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Contains(double x, double y, double tolerance)
|
||||
{
|
||||
|
||||
@@ -28,9 +28,14 @@
|
||||
var itemValue = Value(data);
|
||||
var radius = Chart.ColumnOptions.Radius;
|
||||
|
||||
if (radius > width / 2 || columnIndex < stackedColumnSeries.Count - 1)
|
||||
if (radius > 0)
|
||||
{
|
||||
radius = 0;
|
||||
var items = stackedColumnSeries.SelectMany(series => series.ItemsForCategory(category(data))).ToList();
|
||||
var index = items.IndexOf(data);
|
||||
if (radius > width / 2 || index < items.Count - 1)
|
||||
{
|
||||
radius = 0;
|
||||
}
|
||||
}
|
||||
|
||||
var y0 = GetColumnBottom(data, columnIndex, category, stackedColumnSeries);
|
||||
|
||||
@@ -102,6 +102,18 @@ namespace Radzen.Blazor
|
||||
return Items.Where(item => category(item) == value).Select(Value);
|
||||
}
|
||||
|
||||
IEnumerable<object> IChartStackedColumnSeries.ItemsForCategory(double value)
|
||||
{
|
||||
if (Items == null)
|
||||
{
|
||||
return Enumerable.Empty<object>();
|
||||
}
|
||||
|
||||
var category = ComposeCategory(Chart.CategoryScale);
|
||||
|
||||
return Items.Where(item => category(item) == value).Cast<object>();
|
||||
}
|
||||
|
||||
double IChartStackedColumnSeries.ValueAt(int index)
|
||||
{
|
||||
if (Items == null || index < 0 || index >= Items.Count)
|
||||
|
||||
Reference in New Issue
Block a user