Skip to content

Combined charts order does not appear to impact render order. #136

Closed
@TroelsL

Description

@TroelsL

Description

The order in which charts are entered in ChartExtensions.Combine does not determine how they are rendered.

Repro steps

Please provide the steps required to reproduce the problem

  1. Run the following code:
var x = Enumerable.Range(0,10);
var y = x.Select(x => x * 1.1d);
var y2 = y.Select(x => x * 0.9d);
var chart = ChartExtensions.Combine(new [] { 
    Chart.Area<int,double, string>(x: x, y: y2, Name: "Two", Color: "#dd0000"),
    Chart.Column<int,double, string>(keys: x, values: y, Name: "One", Color: "#00dd00"),
});
            
display(chart);
  1. Observe the resulting visual.
  2. Move the Column chart above (before) the Area chart in the array:
var x = Enumerable.Range(0,10);
var y = x.Select(x => x * 1.1d);
var y2 = y.Select(x => x * 0.9d);
var chart = ChartExtensions.Combine(new [] { 
    Chart.Column<int,double, string>(keys: x, values: y, Name: "One", Color: "#00dd00"),
    Chart.Area<int,double, string>(x: x, y: y2, Name: "Two", Color: "#dd0000"),
});
            
display(chart);
  1. Observe the resulting visual.

Ob

Expected behavior

I would expect the bars to block view of the area chart in the first example.

Actual behavior

The two renders are identical except for the legend.

Known workarounds

None that I know of.

Related information

  • Executed in Jupyter on Alpine Linux
  • Branch: 2.0.0-preview.6
  • .NET 5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions