In Development
Last Updated: 02 Sep 2025 06:40 by ADMIN
Reasult
Created on: 29 Aug 2025 11:53
Category: Telerik Document Processing
Type: Bug Report
1
SpreadProcessing: DataBar conditional formatting with middle axis cannot be created

When creating a data bar conditional formatting with middle axis, a plain data bar with left axis is created instead. Using the following code:

var dataBarValueContext = new DataBarValueContext
{
    MaximumValue = new NumericValue(1),
    MinimumValue = new NumericValue(-1)
};
// Create the rule and set the desired formatting
var rule = new DataBarRule(dataBarValueContext)
{
    UseGradientFill = false,
    Direction = DataBarDirection.Context,
    FillColor = ThemableColor.FromColor(Colors.Green),
    NegativeFillColor = ThemableColor.FromColor(Colors.Red),
    ShowBarsOnly = true,
    AxisPosition = DataBarAxisPosition.Automatic
};

var conditionalFormat = new ConditionalFormatting(rule);

worksheet.Cells[0, 0, 1, 0].AddConditionalFormatting(conditionalFormat);
worksheet.Cells[0, 0].SetValue(0.5);
worksheet.Cells[1, 0].SetValue(-0.5);

The expected value is this:

The result value is instead:

0 comments